Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for DB2 CLI User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.2 Databases and Connections

This section describes the arguments used to build a connect string to a DB2 database.

In order for a SourcePro DB 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 Module:

The second example shows how to open the same database from a Windows application. In this case, the accessLib is defined as "db28012d.dll", indicating that the application will dynamically load the Access Module at runtime:

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

The library name shown is for Solaris and AIX.



Previous fileTop of DocumentContentsIndex pageNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.