Establishing a C Connection to the Database
The utilities listed in
Table 7 do not test whether C or C++ programs written to use a database are able to access the database server. To do that you must compile, link, and run a program that requires access. Database vendors distribute sample programs that allow you to compile and test applications.
Compile, link, and run at least one of the sample C programs distributed by your database vendor.
Table 7 lists information about these programs. They should be available in one of the directories established when your database software was installed.
If possible, use the same compiler you plan to use for your DB Interface Module applications. This is an important step, because it ensures that the required library and header files are present, and that they are compatible with your compiler and linker. If you are unable to compile and link with the sample programs, you will be unable to compile and link DB Interface Module applications.
NOTE: Rogue Wave technical support cannot help you to compile, link, and run the sample programs from your database vendor. If you have problems, please consult your system administrator or database vendor.
Table 7 – Database sample programs
Database | Windows sample programs | UNIX sample programs |
---|
DB2 Server | Distributed with DB2 SDK | Distributed with DB2 SDK |
Microsoft SQL Server | Distributed by Microsoft SQL Server. Typical location is c:\mssql7\devtools\samples\odbc | |
MySQL | Distributed with MySQL Client | Distributed with MySQL Client |
ODBC | Distributed by Microsoft with the ODBC Software Developer’s Kit | Distributed with ODBC drivers |
Oracle OCI | Distributed with Pro*C | Distributed with Pro*C |
PostgreSQL | A third-party libpq application | A third-party libpq application |
Sybase | Distributed by Sybase with Open Client | Distributed by Sybase with Open Client |