Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.2 Databases and Connection

This section describes the arguments used to build a connect string to a DB2 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. The parameters are used to build a connect string that is passed to the DB2 CLI function SQLDriverConnect(). The string is of the form:

Here is an explanation of each argument:

Here are several examples of connecting to a server called INHOUSE on a DB2 Common Server.

In the first example, both the user name and the password are given to provide the highest level of security. Notice that the accessLib is defined as DB2CLI, indicating that the application must be linked with the static version of the access library:

The second example shows how to open the same database from a Windows NT application. In this case, the accessLib is defined as "db24d.dll", indicating that the application will dynamically load (DLL) the access library at runtime:

The final example demonstrates how to open the same database again using the access library as a Unix shared library at runtime:

The library name shown is for Solaris and AIX.


Previous fileTop of DocumentContentsIndexNext file

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