Databases and Connections
In order for a SourcePro DB application to interact with a database, an
RWDBDatabase instance must be created by calling:
RWDBManager::database(accessLib, serviceName, userName,
passWord, "");
All arguments are of type
RWCString. For Oracle OCI, you must provide the following:
accessLib: If you are using DLLs or shared libraries, provide the name of the shared library or DLL; for example,
oci<ver>12d.dll. See the document
Building Your Applications for information about naming conventions. If you are using a static library, supply the string
ORACLE_OCI.
serviceName: Supply the Oracle service name for your connection; ask your DBA for assistance.
userName: Supply the user name of a valid Oracle user.
passWord: Supply the password for the user.
Note: You can instead provide a password using the callback API, which may provide more security. For more information, see Chapter 10, “Callbacks” in the DB Interface Module User’s Guide.
databaseName: Empty string.
Here are two examples of opening a database in an Oracle OCI service. In the first example, the accessLib is defined as ORACLE_OCI, indicating that the application must be linked with the static version of the Access Module:
RWDBManager::database("ORACLE_OCI", "INHOUSE", "cratchitt",
"scrooge", "");
The second example shows how to open the same database from a Windows application. In this case, the accessLib is defined as oci<ver>12d.dll, which indicates that the application will dynamically load the Access Module at runtime:
RWDBManager::database("oci<ver>12d.dll", "INHOUSE", "cratchitt",
"scrooge", "");