company logo

Database :: databaseContext - Get database context

The function returns the database context. This is either an application specific context class instance or an instance of the common database context class (DatabaseContext).

The database context class can be used in order to call actions (business rules) implemented in the context class from within an application.

Since the data base is an object space, as well, the application might also refer to the objectSpaceContext(). The database context is mainly used in order to support login and user registration functions when opening a database.

  DatabaseContext   &dc = database.databaseContext();

  dc.executeAction("userCount");

  output(dc.result());

Notes:

One cannot create a copy from a context object, i.e. one must not assigne context class object on value level.

Return value:  Database context ( odaba::DatabaseContext & )

Database context usually refers to an instance of an application defined database context class. When no database context has been defined in the application, the context refers to the default database context class.

Implementation details

odaba::DatabaseContext & Database  :: databaseContext (  )