To configure the Objectivity/SQL++ ODBC Driver, refer to the following:
You enable ODBC-compliant client applications to access an Objectivity/DB federated database by adding a data source for it. In general, a data source identifies the data to be accessed and the means of accessing it (for example, host and network information). The data source you add for a federated database specifies its boot file and a host running a Objectivity/SQL++ ODBC server.
Before you add a data source for a federated database:
- Identify the Objectivity/SQL++ ODBC server that will access the federated database and obtain:
- The TCP/IP name of the computer that runs the ODBC server.
- The service name under which the ODBC server is running.
- Obtain the location and name of the federated database's boot file.
- Ensure that you have a valid user account on the host running the Objectivity/SQL++ ODBC server.
To add a data source for a federated database:
- In the Control Panel on the host where you installed Objectivity/ODBC (the driver), open Administrative Tools and open Data Sources (ODBC).
- In ODBC Data Source Administrator, click System DSN (or User DSN, if you want to create a personal data source).
- Click Add, select Objectivity ODBC Driver in the Create New Data Sources dialog, and click Finish.
- In the resulting dialog, fill in the following fields and then click OK:
Data Source Name
A string that uniquely identifies the data source. This string will appear in the list of data sources in the connection dialog. The string may not exceed 32 characters.
(Optional) A description of the data source.
The TCP/IP name of the computer running the Objectivity/SQL++ ODBC server.
The location and name of the boot file for the federated database, expressed as a fully qualified pathname beginning with a drive letter.
The username of your Objectivity/SQL++ account. This is normally your login account on the ODBC server host, provided that this account has been granted access rights to tables in the federated database (see your Objectivity/SQL++ database administrator). The Objectivity/SQL++ database administrator account (systpe) has access to all tables.
Password for the account you entered in the User ID field. The password you enter is not encoded before it is sent across the network.
The service name of the ODBC server on its host (oosqlnw).
Note: The Host, Database, and Service fields together must not exceed a string-length of 249 characters.
- Click OK.
- If you want to add other data sources, repeat steps 3 through 5.
- When you are finished adding data sources, click OK.
You or your system administrator must perform the following steps to enable your ODBC-compliant application to communicate with the Objectivity/SQL++ ODBC server across the network.
Identifying the ODBC Server’s Host to TCP/IP
TCP/IP must be able to recognize the hostname you specify when you register a data source. That is, TCP/IP must be able to convert the hostname into an Internet address. Many sites use the TCP/IP hosts file to map hostnames to Internet addresses, although some sites use domain name servers for this purpose.
You should verify that the computer on which you installed Objectivity/ODBC recognizes a valid hostname for the computer on which the ODBC server is running. For example, to verify that your computer recognizes hostname, you can:
► Enter the following command at a command prompt:
Specifying the ODBC Server’s Port Number
As installed, the Objectivity/SQL++ ODBC server and the Objectivity/SQL++ ODBC Driver communicate through a default TCP/IP port. If the ODBC server has been assigned a nondefault port number (for example, due to a port conflict), you must register the new port number with TCP/IP on each Objectivity/ODBC (driver) host.
To register the ODBC server’s port number with TCP/IP:
- Find the TCP port number assigned to the oosqlnw service on the host running the Objectivity/SQL++ ODBC server. For example, use the Objectivity Network Services tool on the ODBC server host.
- On the host where you installed Objectivity/ODBC (the driver), open the TCP/IP services file. The location of this file depends on the TCP/IP vendor. The Microsoft TCP/IP file location is:
- Add the following entry to the TCP/IP services file, if such an entry does not already exist:
oosqlnw portNumber/tcp # Objectivity/SQL++ server
portNumberis the TCP port number you found in step 1.
You can verify the correct operation of Objectivity/ODBC in combination with an Objectivity/SQL++ ODBC server. The following test (which requires a C++ development environment) compiles and links a sample ODBC application and uses that application to access a demo federated database. The demo federated database is provided with Objectivity/SQL++ on the server host.
The sample application is a C++ application that calls ODBC 3.0 functions to query and modify a federated database. You can inspect the sample to see how such an application is compiled and linked.
To build and run the sample ODBC-compliant application:
- Verify that the demo federated database and the Objectivity/SQL++ ODBC server have been set up for this test:
- On the Objectivity/ODBC (driver) host, add a data source for the demo federated database.
- (Optional) Make a backup copy of the Objectivity/SQL++ ODBC samples directory.
- Check whether the lock server is running; start it, if necessary.
- From the
odbcsample directory, build and run the sample application:
If the Objectivity/SQL++ ODBC programming interface is set up correctly, you will see messages like these:
Welcome to the Objectivity/SQL++ ODBC demo ... Building the ooODBCdemo executable ... Running the demo... Demo complete. Comparing the results. Test PASSED -- The expected results were achieved. No errors.