This section describes how to register ODBC data sources on Linux.
Registering data sources
Edit the odbc.ini definition file for the data source.
Information
Edit the file in the installation directory for the ODBC driver manager (unixODBC)
unixOdbcInstallationDir/etc/etc/odbc.ini
Or
Create a new file in the HOME directory
~/.odbc.ini
Point
If unixOdbcInstallationDir is edited, these will be used as the shared settings for all users that log into the system. If created in the HOME directory (~/), the settings are used only by the single user.
Set the following content:
Definition name | Setting value |
---|---|
[Data source name] | Set the name for the ODBC data source. |
Description | Set a description for the ODBC data source. Any description may be set. |
Driver | Set the following as the name of the ODBC driver. Do not change this value.
|
Database | Specify the database name to be connected. |
Servername | Specify the host name for the database server. |
Username | Specify the user ID that will connect with the database. |
Password | Specify the password for the user that will connect to the database. |
Port | Specify the port number for the database server. The default is "26500". |
SSLMode | The setting values for SSLMode are as follows:
|
ReadOnly | Specify whether to set the database as read-only.
|
*1: If specifying either "verify-ca" or "verify-full", use the environment variable PGSSLROOTCERT to specify the CA certificate file as shown below.
Example
export PGSSLROOTCERT=caCertificateFileStorageDir/root.crt
Linux 32-bit
[MyDataSource] Description = SymfowareServer Driver = SymfowareServerV12.0ansi Database = db01 Servername = sv1 Port = 26500 ReadOnly = 0
Note
In consideration of security, specify the UserName and the Password by the application.
Environment variable settings
The LD_LIBRARY_PATH environment variable needs to be set to execute applications that use ODBC drivers.
The following are examples of setting the LD_LIBRARY_PATH:
Linux (32-bit)
Setting example (TC shell)
setenv LD_LIBRARY_PATH /usr/local/lib(*1)(*2):/opt/symfoclient32/lib:${LD_LIBRARY_PATH}
Setting example (bash)
LD_LIBRARY_PATH=/usr/local/lib(*1)(*2):/opt/symfoclient32/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH
Linux (64-bit)
Setting example (TC shell)
setenv LD_LIBRARY_PATH /usr/local/lib(*1)(*2):/opt/symfoclient64/lib:${LD_LIBRARY_PATH}
Setting example (bash)
LD_LIBRARY_PATH=/usr/local/lib(*1)(*2):/opt/symfoclient64/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH
*1: This is an example of building and installing from the source without specifying an installation directory for unixODBC. If you wish to specify a location, set the installation directory.
*2: This is an example of building and installing from the source without specifying an installation directory for libtool. If you wish to specify a location, set the installation directory.