Entering content frame

 Integration of the MaxDB ODBC driver 

Use

You can use the MaxDB ODBC driver on UNIX/Linux both with and without a Driver Manager.

By entering link commands, you connect the static library libsqlod.a or the dynamic library libsqlod.so with the application. Ensure with dynamic links that the dynamic library libsqlod.so is found by the system at execution time (see, for example, Idconfig, LD_LIBRARY_PATH).

Procedure

Use with a Driver Manager

Using a Driver Manager, such as iODBC or unixODBC simplifies the exchange of ODBC drivers and allows the concurrent use of different ODBC drivers. The relevant documentation describes how you integrate an ODBC driver into the Driver Manager.

Use Without a Driver Manager

If you are not using a Driver Manager, you must use an editor to enter the data for the MaxDB ODBC driver manually, either in the file ~/. odbc.ini or the file /etc/odbc.ini.

Result

The system first uses the valid .odbc.ini file for the respective user from his or her home directory during the assignment of data sources. If no suitable data source is found there, the system evaluates the file /etc/odbc.ini.

Using the ODBC Driver without a Driver Manager

Compiler command:

Compile the ODBC application myapp.c with appropriate ODBC header files

cc –c myapp.c –I<ODBC_include>

Link command for static library:

Static linking of the application myapp

cc –o myapp myapp.o <ODBC_lib>/libsqlod.a

Link command for dynamic library:

Dynamic linking of the application myapp

cc –o myapp myapp.o –L<ODBC_lib> -lsqlod

 

 

Leaving content frame