The examples use include files with hard-coded values for database name, database server, database user name and database user password. You must change these values to reflect your own organizational settings.
On Windows, <buildspace>\examples\<module>\12d\tutdefs.h contains configuration variables used by the examples. Section 4.2.1 explains how to modify the tutdefs.h file for your own database connection.
On UNIX, the <buildspace>/examples/<module>/12d/tutdefs.h file is generated by the makefile and must be modified for your own database connection (see Section 4.2.2).
Modify this file as follows:
Do not change DBSERVER_TYPE.
Change DBSERVER_NAME to the name of your database server.
Change DBUSER_NAME and DBPASSWORD to a valid user name and password for your database; the user account must have permission to create tables on the database in order to run the tutorials.
If your database requires it, specify the database name using DBDATABASE_NAME.
If your database requires it, specify the property string using DBDATABASE_PSTRING. Please refer to the Access Module Reference Guide of the access module you are using for the contents of the property string.
For example, your configuration file might look like this:
#define DBSERVER_TYPE "msq6212d.dll" #define DBSERVER_NAME "DataSource" #define DBUSER_NAME "username" #define DBPASSWORD "password" #define DBDATABASE_NAME "database" #define DBDATABASE_PSTRING "" |
These values are compiled into the tutorials when you build them. If you need to change the values at a later time, you must clean the example object files with an nmake clean, then rebuild the tutorials. (See Section 4.3.)
On UNIX, the database connection values are hard-coded in the makefile for each example, as part of the rule to create the tutdefs.h header file. For example, the following excerpt shows the placeholder values for an Oracle OCI examples makefile on Red Hat Linux:
tutdefs.h: echo '#define DBSERVER_TYPE "liboci6212d.so"' >> tutdefs.h echo '#define DBSERVER_NAME "server"' >> tutdefs.h echo '#define DBUSER_NAME "username"' >> tutdefs.h echo '#define DBPASSWORD "password"' >> tutdefs.h echo '#define DBDATABASE_NAME ""' >> tutdefs.h echo '#define DBDATABASE_PSTRING ""' >> tutdefs.h |
The values that are quoted and highlighted must be changed to reflect your own database connection before you build and run the examples. In the UNIX distributions there are four database modules that need these changes: Oracle OCI, ODBC, MySQL, PostgreSQL.
These values are compiled into the tutorials when you build them. If you need to change the values at a later time, you must clean the example object files with a make clean, then rebuild the tutorials. (See Section 4.3.)
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.
Provide feedback to Rogue Wave about its documentation.