InterSystems IRIS Data Platform 2019.2  /  Using the InterSystems ODBC Driver

Using the InterSystems ODBC Driver
Defining an ODBC Data Source on UNIX®
Previous section           Next section
InterSystems: The power behind what matters   

An external application can use InterSystems databases as ODBC data sources. This chapter describes how to create a DSN for an InterSystems database on UNIX®, which you do by editing the ODBC initialization file.
Structure of the ODBC Initialization File
The ODBC initialization file is used as follows:
The following is a sample initialization file for the InterSystems ODBC driver:
[ODBC Data Sources]

Driver          = /usr/irissys/bin/
Description     = InterSystems IRIS ODBC driver
Host            = localhost
Namespace       = USER
UID             = _SYSTEM
Password        = SYS
Port            = 51773
Protocol        = TCP
Query Timeout   = 1
Static Cursors  = 0
Trace           = off
TraceFile       = iodbctrace.log
Authentication Method   = 0
Security Level          = 2
Service Principal Name  = iris/

Driver = /usr/irissys/bin/
This file includes the following variables:
For more information on Kerberos, see the Security Administration Guide.
Setting up a DSN with odbcinst
A UNIX® ODBC installation includes the program odbcinst. The location is dependent on the install but may be located under /usr/local/bin for example.
There are two template files included with a UNIX® installation located in install-dir\dev\odbc\redist\unixodbc. These are:
Edit the template files to suit your configuration. To use them, you can call odbcinst in the following ways:
From: install-dir\dev\odbc\redist\unixodbc\odbcinst.ini_unixODBCtemplate
[InterSystems ODBC]
CPTimeout=<not pooled>
Setting up SSL Configuration Files
InterSystems IRIS provides two template files for SSL configuration. The files are located in install-dir\dev\odbc\redist\ssl. The directory also contains a readme.txt file with further information.
This is a sample odbc.ini file with an entry named [SampleSSL] that defines an SSL connection. A working file would typically be named install-dir/mgr/irisodbc.ini.
  [ODBC Data Sources] 
  SamplesSSL = SampleSSL 

  Driver = /home/guest/iris/bin/ 
  Description = IRIS ODBC driver 
  Host = localhost 
  Namespace = SAMPLES 
  Password = SYS 
  Port = 1972 
  Protocol = TCP 
  Query Timeout = 1 
  Static Cursors = 0 
  Trace = off 
  TraceFile = iodbctrace.log 
  Service Principal Name = iris/ 

  Authentication Method = 2 
  Security Level = 10 
  SSL Server Name = SampleSSLConfig 
In the example above, the last three lines specify the SSL connection. The values must be defined as follows:
This is a sample SSL configuration file. In order for a process to initiate an SSL connection with these values:
This example defines the following values:
See “Using SSL/TLS” for detailed information on these values.
Name and Location of the Initialization File
The initialization file can have any name, but, typically, it is called .odbc.ini when it is located in a user’s personal directory, odbc.ini when located in an ODBC-specific directory. The InterSystems sample is called irisodbc.ini and is located in the install-dir/mgr directory.
To locate this file, the InterSystems ODBC client driver uses the same search order as iODBC. It looks for the file in the following places, in this order:
  1. The file specified by the ODBCINI environment variable, if this is defined. When defined, this variable specifies a path and file, such as:
    export ODBCINI
  2. The .odbc.ini file in the directory specified by the user’s $HOME variable, if $HOME is defined and if .odbc.ini exists.
  3. If $HOME is not defined, the .odbc.ini file in the “home” directory specified in the passwd file.
  4. The file specified by the system-wide SYSODBCINI environment variable, if this is defined. When defined, this variable specifies a path and file, such as:
    export SYSODBCINI 
  5. The file odbc.ini file located in the default directory for building the iODBC driver manager (/etc/), so that the full path and file name are /etc/odbc.ini.
To use a different odbc.ini file, delete or rename the InterSystems sample initialization file to allow the driver manager to search the $HOME or /etc/odbc.ini paths. For example, go to install-dir/bin and execute the following command:
and then move your user-defined odbc.ini to etc/odbc, where the driver manager can find it.

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-09-18 06:45:48