The Data Sources window opens.
If either the ODBC Driver Manager or the IBM DB2 CLI/ODBC driver is not installed then double-click on the Install ODBC Driver icon in the DB2 folder to install both the DB2 CLI/ODBC driver and the ODBC driver manager.
For information on manually editing this file (db2cli.ini), see Configuring db2cli.ini.
If you require additional information at this point you can refer to the following topics in Detailed Configuration Information: |
Before DB2 CLI and ODBC applications can successfully access a DB2 database from a UNIX client, perform the following steps on the client system:
For more information see Chapter 10. Configuring Client-to-Server Communications Using the Command Line Processor or the CATALOG DATABASE and CATALOG NODE commands in the Command Reference.
Setting up odbcinst.ini
The settings in this file impact all of the ODBC drivers on the machine.
Use an ASCII editor to update this file. It must have a stanza (section) called [IBM DB2 ODBC DRIVER], with a line starting with 'Driver' indicating the full path to the DB2 ODBC driver (db2.o). For example, if the home directory of your end user is /u/thisuser/ and the sqllib directory is installed there, then the correct entry would be:
See the sample file in the sqllib/odbclib subdirectory for an example.
Setting up odbc.ini
The settings in this file are associated with a particular user on the machine; different users can have different odbc.ini files.
The odbc.ini file must be copied into the end user's home directory and called .odbc.ini. Update this file, using an ASCII editor, to reflect the appropriate data source configuration information. To register a DB2 database as an ODBC data source there must be one stanza (section) for each DB2 database.
The sample odbc.ini template shows:
Indicates that there is a data source called SAMPLE that used the IBM DB2 ODBC DRIVER.
Indicates that the SAMPLE database is part of the DB2 instance located in the directory /u/thisuser.
Indicates that /u/thisuser/sqllib/odbclib should be treated as the location where ODBC is installed.
Note: | If your application specifically installed the ODBC components (such as the Driver Manager) elsewhere, you must update the line starting with InstallDir under the [ODBC] stanza to reflect this new location. For example, if ODBC has been installed in /opt/odbc, the [ODBC] stanza would look like: |
See the sample file in the sqllib/odbclib subdirectory for an example. You can also see How to Configure ODBC.INI for more detailed information. Epson v300 scanner.
Once the .ini files are set up you can run your ODBC application and access DB2 databases. Refer to the documentation that comes with your ODBC application for additional help and information.
There are various keywords and values that can be used to modify the behavior of DB2 CLI/ODBC and the applications using it. The keywords are associated with the database alias name, and affect all DB2 CLI/ODBC applications that access the database.
For information on manually editing this file (db2cli.ini), see Configuring db2cli.ini. For information about the specific keywords see the CLI Guide and Reference.
If you require additional information at this point you can refer to the following topics in Detailed Configuration Information: |
Before DB2 CLI and ODBC applications can successfully access a DB2 database from a Macintosh client, perform the following steps on the client system:
For more information see Configuring Database Connections.
The MacODBC driver manager uses the ODBC Preferences file or the ODBC Preferences PPC file to record information about the available drivers and data sources.
It is also possible to modify these files manually. Do not change any of the existing entries in the files.
For each data source listed in the [ODBC Data Source] section, there is a section that lists additional information about that data source. These are called the Data Source Specification sections.
Under the [ODBC DATA SOURCE] entry, add the following line:
where database_alias is the alias of the database cataloged in the database directory (the database name used by the Command Line Processor CONNECT TO statement).
Where database_alias is the alias of the database cataloged in the database directory, and listed under the Data Source Specification section.
The section Platform Specific Details for CLI/ODBC Access should provide you with all of the information you require. The following additional information is useful where DB2 tool support is not available, and for administrators who require more detailed information.
The following topics are covered in this section: |
The CLI/ODBC driver will autobind on the first connection to the database, provided the user has the appropriate privilege or authorization. The administrator may want to perform the first connect or explicitly bind the required files.
See Binding Database Utilities for more information.
DB2 CLI can be configured further by using either the CCA or the DB2 Client Setup administration tool, whichever is applicable for your platform, or by manually editing the db2cli.ini file.
This file contains various keywords and values that can be used to modify the behavior of DB2 CLI and the applications using it. The keywords are associated with the database alias name, and affect all DB2 CLI and ODBC applications that access the database.
By default, the location of the CLI/ODBC configuration keyword file is as follows:
The environment variable DB2CLIINIPATH can also be used to override the default and specify a different location for the file.
The configuration keywords enable you to:
The db2cli.ini initialization file is an ASCII file which stores values for the DB2 CLI configuration options. A sample file is shipped to help you get started. Refer to the CLI Guide and Reference for information on each keyword.
See Platform Specific Details for CLI/ODBC Access for more information on how to modify this file on your platform.
Microsoft's 16-bit ODBC Driver Manager and Visigenic's ODBC Driver Manager use the odbc.ini file to record information about the available drivers and data sources. Visigenic's ODBC Driver Manager also uses the odbcinst.ini file on UNIX platforms. Although the necessary files are updated automatically by the tools on most platforms, users of ODBC on UNIX platforms will have to edit them manually. The file odbc.ini (and odbcinst.ini where required) are located:
It is also possible to modify this file manually. Do not change any of the existing entries in the file.
The following is an example odbc.ini file:
The [ODBC Data Sources] section lists the name of each available data source and the description of the associated driver.
For each data source listed in the [ODBC Data Sources] section, there is a section that lists additional information about that data source. These are called the Data Source Specification sections.
where database_alias is the alias of the database cataloged in the database directory (the database name used by the command line processor CONNECT TO statement).
Where:
UNIX Configuration of .ini files
The section UNIX Client Access to DB2 using CLI/ODBC contains detailed steps on how to update both the odbc.ini and odbcinst.ini files.
[ Top of Page Previous Page Next Page Table of Contents Index ][ DB2 List of Books Search the DB2 Books ]