15.3.1 Specifying data sources
The following shows the procedure for registering data sources when using unixODBC (which is provided as open source) as the driver manager. The specification examples shown in the procedure assume that the installation directory for the HADB client is /home/osuser01/clientdir.
- Note
-
The HADB ODBC driver does not support data source registration using the ODBC Config GUI tool provided by unixODBC.
Procedure
-
Configure odbcinst.ini.
Edit odbcinst.ini stored in the /usr/local/etc folder to register the HADB ODBC driver information. To output the ODBC trace, specify instructions for starting and stopping the ODBC trace, as well as information about the ODBC trace output destination in odbcinst.ini. The settings in the edited odbcinst.ini are applied to all users.
Note that odbcinst.ini is owned by the root user, so you need to edit it as the root user.
Specification example
[Hitachi Advanced Database] ...a Driver = /home/osuser01/clientdir/client/lib/libadbodbc.so ...b [ODBC] ...c Trace = YES ...d TraceFile = /home/osuser01/clientdir/spool/odbctrc_DM.log ...e
Explanation:
-
Specify the data source and the corresponding driver name. Specify "Hitachi Advanced Database".
-
Specify the HADB ODBC driver by using an absolute path.
-
Specify the [ODBC] tag to output the ODBC trace.
-
Specify this to output the ODBC trace.
You can specify "YES" or "NO" to start or stop the ODBC trace output.
-
To output the ODBC trace, specify the absolute path of the file to which the ODBC trace will be output. Specify a name of your choice for the file name.
Additionally, for the output folder of the ODBC trace, specify a folder for which the user executing the application program has access privilege.
-
-
Configure .odbc.ini.
Edit .odbc.ini to register the HADB ODBC driver information. Store .odbc.ini in the home directory of the user executing the application.
Specification example
[HADB] ...a Driver = Hitachi Advanced Database ...b CLTPATH = /home/osuser01/clientdir/conf/client.def ...c
Explanation:
-
Specify a name of your choice to identify the data source name. Restrictions on the specified value depend on the specifications of the driver manager.
-
Specify the driver name.
Specify "Hitachi Advanced Database" as the driver name specified in odbcinst.ini in step 1.
-
Specify the absolute path of the client definition file (client.def) to be used for this data source.
This specification is optional. If you omit the specification, the client definition file ($ADBCLTDIR/conf/client.def) in the directory specified by the environment variable ADBCLTDIR will be used.
-