iAnywhere Solutions ODBC Drivers
Introduction to ODBC Drivers
Quick start for UNIX
In the UNIX environment, there is no ODBC administrator. To configure a data source, you must edit the system information file, a plain text file that is normally located in your $HOME directory and is usually called .odbc.ini. This file is maintained using any text editor, and defines data source entries as described in the following sections:
Sybase Adaptive Server Enterprise Connecting to a data source using a connection string.
Oracle Connecting to a data source using a connection string.
IBM DB2 Connecting to a data source using a connection string.
You must use the long name of connection string attributes when defining data source entries. A sample file (odbc.ini.sample) is located in the driver installation directory.
For a list of key driver settings when using MobiLink, see Key driver settings for MobiLink.
There must be an [ODBC] section in the system information file that includes the InstallDir keyword. The value of this keyword must be the path to the directory under which the /lib and /messages directories are contained. For example, if you choose the default install directory, then the following line must be in the [ODBC] section:
InstallDir=/opt/sybase/SYBSsa9/drivers
The following is a sample system information file for Solaris:
; This is only a sample .odbc.ini file ; IT WILL NOT WORK AS IS. ; You need to make a copy of this file ; into the user's home directory and modify ; the DSNs (Data Source Names) to your needs: ; ; cp odbc.ini.sample ~/.odbc.ini ; vi ~/.odbc.ini ; ; You also need to modify the default ; value of your ODBCINI environment variable. ; It should be set to point to your local ; copy of the .odbc.ini file: ; export ODBCINI=~/.odbc.ini ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ODBC Data Sources] SybaseASA=Adaptive Server Anywhere 9 Driver Oracle Wire Protocol=iAnywhere Solutions 9 - Oracle Wire Protocol Driver Sybase ASE Wire Protocol=iAnywhere Solutions 9 - Sybase ASE Driver DB2 Wire Protocol=iAnywhere Solutions 9 - DB2 Wire Protocol Driver
[SybaseASA] Driver=/opt/sybase/SYBSsa9/lib/libdbodbc9_r.so UID=dba PWD=sql ServerName=asademo CommLinks=tcpip
[Oracle Wire Protocol] Driver=/opt/sybase/SYBSsa9/drivers/lib/wqora19.so Description=iAnywhere Solutions 9 - Oracle Wire Protocol ApplicationUsingThreads=1 ArraySize=60000 CachedCursorLimit=32 CachedDescLimit=0 CatalogIncludesSynonyms=1 CatalogOptions=0 DefaultLongDataBuffLen=1024 DescribeAtPrepare=0 EnableDescribeParam=0 EnableNcharSupport=0 EnableScrollableCursors=0 EnableStaticCursorsForLongData=0 EnableTimestampWithTimeZone=0 HostName=oracleserver LocalTimeZoneOffset= LockTimeOut=-1 LogonID=uid Password=pwd PortNumber=1521 ProcedureRetResults=0 SID=oraclesid UseCurrentSchema=1
[Sybase ASE Wire Protocol] Driver=/opt/sybase/SYBSsa9/drivers/lib/wqase19.so Description=iAnywhere Solutions 9 - Sybase ASE Wire Protocol ApplicationName= ApplicationUsingThreads=1 ArraySize=50 Charset= CursorCacheSize=1 Database=db DefaultLongDataBuffLen=1024 EnableDescribeParam=1 EnableQuotedIdentifiers=0 InitializationString= Language= LogonID=uid NetworkAddress=serverhost,4100 OptimizePrepare=2 PacketSize=0 Password=pwd RaiseErrorPositionBehavior=0 SelectMethod=0 WorkStationID=
[DB2 Wire Protocol] Driver=/opt/sybase/SYBSsa9/drivers/lib/wqdb219.so Description=iAnywhere Solutions 9 - DB2 Wire Protocol AddStringToCreateTable= AlternateID= Collection= Database=db DynamicSections=100 GrantAuthid=PUBLIC GrantExecute=1 IpAddress=db2host IsolationLevel=CURSOR_STABILITY Location= LogonID=uid Password=pwd Package=pkg PackageOwner=uid TcpPort=50000 WithHold=1
[ODBC] IANAAppCodePage=4 InstallDir=/opt/sybase/SYBSsa9/drivers Trace=0 TraceDll=/opt/sybase/SYBSsa9/drivers/lib/odbctrac.so TraceFile=odbctrace.out UseCursorLib=0
UNIX support of the database drivers also permits the use of a centralized system information file that a system administrator can control. This is accomplished by setting the environment variable ODBCINI to point to the fully qualified path name of the centralized file. For example, in the C shell you could set this variable as follows:
setenv ODBCINI /opt/odbc/system_odbc.ini
In the Bourne or Korn shell, you would set it as:
ODBCINI=/opt/odbc/system_odbc.ini;export ODBCINI
The search order for the location of the system information file is as follows:
Check ODBCINI
Check $HOME for .odbc.ini