open( database handle )

Open the SQL engine with a database handle.

For an overview see page McoSqlEngine

Prototype

    void open(mco_db_h db);

Arguments

db
The handle of an opened eXtremeDB database (returned from function mco_db_connect()).

Description

This method opens an eXtremeDB SQL mapper and the McoSqlEngine instance with the database handle in argument db.

Returns

This method throws a RuntimeException in the case of an error.

Example

    const char * db_name = "SimpleDb";

    int main(int argc, char* argv[])
    {
        MCO_RET rc;
        sample_memory_t dbmem;
        McoSqlEngine engine;

        ...
        mco_runtime_start();
        rc = sample_open_database( db_name, SimpleDb_get_dictionary(), DATABASE_SIZE, CACHE_SIZE,
            MEMORY_PAGE_SIZE, PSTORAGE_PAGE_SIZE, 1, &dbmem );
        if ( MCO_S_OK == rc )
        {
            rc = mco_db_connect(db_name, &db);
            if ( MCO_S_OK == rc )
            {
                engine.open(db);

                ...
            }
        }
    }