Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.2 Databases and Connections

This section describes the arguments used to build a connect string to an Informix database. In order for a DBTools.h++ application to interact with a database, an RWDBDatabase instance must be created by calling:

All arguments are of type RWCString. These parameters are used to build a connect string that is passed to the Informix ODBC Driver function SQLDriverConnect(). The string is of the form:

The arguments you must provide to RWDBManager::database() are:

Here are three examples of opening a database. The first example uses a driver to access a data source (DSN) named "inf33nt". A user name and password are provided, as well as a database: "ACCOUNTING". Notice that accessLib is defined as "inf4d.dll", indicating that the application will dynamically load (DLL) the access library at runtime:

In the second example, the accessLib is defined as "INFORMIX", indicating that the application must be linked with the static version of the access library:

The third example uses a driver on a Unix machine to access the Informix9 data source (DSN). Notice that accessLib is defined as "libinf4d.so", indicating that the application will use the access library as a Unix shared library at runtime:


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.