#includeint main() { try { otl_connect db; // create connection object // connect to the database db.rlogon("user/password@database"); // do some database operations... // log off from the database db.logoff(); } catch (otl_exception& ex) { cerr << ex.msg << endl; } return 0; }
#define OTL_ODBC #includeThis is similar to the first example, but uses the ODBC interface instead of the default Oracle interface. The package library used in this example is likely the ODBC library.int main() { try { otl_connect db; // create connection object // connect to the database db.rlogon("odbc:user/password@database"); // do some database operations... // log off from the database db.logoff(); } catch (otl_exception& ex) { cerr << ex.msg << endl; } return 0; }