company logo

DataSource :: database - Database handle

When the data source handle has been opened successfully, this handle refers to the opened database. The handle can be checked by calling database.isValid().

bool CheckDatabase( DataSource &ds ) {

  return ( ds.database.IsValid() ? OK : FAIL )        

}

Return value:  Database handle ( odaba::Database & )

The database handle refers to an (usually) opened database. Calling functions with invalid database handles may cause an exception. For checking the database handle, isValid() can be called.

Implementation overview

Implementation details

  1. Get database handle
    odaba::Database & DataSource  :: database (  )

    The property returns the database handle for the data source. The database handle might be invalid, when the data source has not been opened or has not been opened successfully.

  2. to list
  3. Set database
    odaba::Database & DataSource  :: database ( odaba::Database &cDatabase )

    The function closes the database handle when being opened. The function copies the database handle passed in rDatabase to the data source database handle. It sets the database path in the data source to the database path extracted from the passed database handle (rDatabase.path()).

    Notes:

    The database handle passed to the function need not fit to the dictionary opened in the data source. No consistency check will be made.

    • cDatabase - Database handle

      The database handle refers to an (usually) opened database. Calling functions with invalid database handles may cause an exception. For checking the database handle, isValid() can be called.

  4. to list