Using ODBC data sources on Unix

On Unix operating systems, ODBC data sources are held in a system information file. By default, this file is named .odbc.ini, but it can have any name. The following locations are searched, in order, for the system information file:

  1. The ODBCINI environment variable.
  2. The ODBC_INI environment variable.
  3. The ODBCHOME environment variable.
  4. The HOME environment variable.
  5. The user's Home directory (~).
  6. The PATH environment variable.
Note

The ODBCINI and ODBC_INI environment variables point to the system information file (which may or may not be named .odbc.ini), while the ODBCHOME and HOME environment variables point to a path where the .odbc.ini file is located.

Both ODBCINI and ODBC_INI specify a full path, including the file name. If the system information file is located in a directory specified by ODBCINI or ODBC_INI, it does not have to be named .odbc.ini.

The following is a sample system information file:

[My Data Source]
ENG=myserver
CommLinks=tcpip(Host=hostname)
UID=DBA
PWD=sql

You can enter any connection parameter in the system information file. See Connection parameters.

Network protocol options are added as part of the CommLinks (LINKS) parameter. See Network protocol options.

Caution

Storing user IDs, passwords (encrypted or unencrypted), and/or database keys in a data source is not secure. It is recommended that you do not store this information in a data source if the database contains sensitive data.

You can create and manage ODBC data sources on Unix using the dbdsn utility.

Caution

You should not add simple encryption to the system information file (named .odbc.ini by default) with the File Hiding utility (dbfhide) on Unix unless you are using only SQL Anywhere data sources. If you plan to use other data sources (for example, for MobiLink synchronization), then obfuscating the contents of the system information file may prevent other drivers from functioning properly.

See also