Contents Index Connecting to a Data Source Using a Logon Dialog Box Data types

iAnywhere Solutions ODBC Drivers
  iAnywhere Solutions ODBC Driver for Oracle

Connecting to a data source using a connection string


If your application requires a connection string to connect to a data source, you must specify the data source name that tells the driver which section in the system information to use for the default connection information. Optionally, you may specify attribute=value pairs in the connection string to override the default values stored in the system information. These values are not written to the system information.

You can specify either long or short names in the connection string. The connection string has the form:

DSN=data_source_name[;attribute=value[;attribute=value]...]

An example of a connection string for Oracle is:

DSN=Accounting;SRVR=QESRVR;UID=JOHN;PWD=XYZZY

If the server name contains a semicolon, enclose it in quotation marks:

DSN=Accounting;SRVR="QE;SRVR";UID=JOHN;PWD=XYZZY

To configure a data source in the UNIX environment, you must edit the system information file. This file accepts only long names for attributes.

For more information, see Quick start for UNIX.

The defaults listed in the table are initial defaults that apply when no value is specified in either the connection string or in the data source definition in the system information. If you specified a value for the attribute when configuring the data source, that value is the default.

Most settings can be left at their default values. For a list of key driver settings when using MobiLink, see Key driver settings for MobiLink.

Attribute Description
AppCodePage (ACP) AppCodePage has been replaced by IANAAppCodePage (IACP). See below.
ApplicationUsingThreads (AUT) ApplicationUsingThreads={0 | 1}. Ensures that the driver works with multi-threaded applications.

When set to 1 (the initial default), the driver is thread-safe.

When using the driver with single-threaded applications, you can set this option to 0 to avoid additional processing required for ODBC thread-safety standards.

Set to 1 for DSNs used with MobiLink server.

ArraySize (AS) The number of bytes the driver uses for fetching multiple rows. Values can be an integer from 1 up to 4 GB. Larger values increase throughput by reducing the number of times the driver fetches data across the network. Smaller values increase response time, as there is less of a delay waiting for the server to transmit data.

The initial default is 60,000.

CachedCursorLimit (CCL) The number of Oracle Cursor Identifiers that the driver stores in cache. A cursor identifier is needed for each open result set. When a result set is closed the driver stores the identifier in its cache, up to the limit specified, rather than tell the Oracle database server to close the cursor identifier. When a new cursor identifier is needed, the driver takes one from its cache, if one is available. Cached cursor identifiers are closed when the connection is closed. The initial default is 32.
CachedDescriptionLimit (CDL) The number of descriptions, from 0 to 65535, that the driver saves for SELECT statements. These descriptions include number of columns, data type, length, and scale for each column. The matching is done by an exact-text match through the FROM clause. The default is 0 because of the overhead of parsing the SQL statement. Using the FROM clause, applications that issue a SELECT statement that returns a few rows repeatedly can realize a significant performance benefit when using this option. NOTE: If the statement contains a UNION or a nested SELECT, the description is not cached. The initial default is 0. Type a value from 0 to 65535. The default value is 0. This value corresponds to the number of descriptions that the driver saves for SELECT statements. These descriptions include number of columns, data type, length, and scale for each column. When this option is enabled, applications that issue a SELECT statement that returns a few rows repeatedly can realize a significant performance benefit. NOTE: If the statement contains a UNION or a nested SELECT, the description is not cached
CatalogIncludesSynonyms (CIS) CatalogIncludesSynonyms={0 | 1}. Determines whether synonyms are included in calls to SQLProcedures, SQLStatistics, and SQLProcedureColumns. When set to 1, synonyms are included in these calls. When set to 0, synonyms are not included (a non-standard behavior) and performance is improved.

The ODBC specification requires that synonyms be included in the result sets of these catalog calls when the calls are unqualified. Most users do not qualify queries; therefore, synonyms are included by default, which slows down performance. This option allows you to improve performance by not including synonyms. The initial default is 1.

CatalogOptions (CO) CatalogOptions={0 | 1}. Determines whether the result column REMARKS for the catalog functions SQLTables and SQLColumns and COLUMN_DEF for the catalog function SQLColumns have meaning for Oracle. If you want to obtain the actual default value, set CO=1. The initial default is 0.
DataSourceName (DSN) A string that identifies an Oracle data source configuration in the system information. Examples include "Accounting" or "Oracle-Serv1."
DefaultLongDataBuffLen (DLDBL) An integer value that specifies, in 1024-byte multiples, the maximum length of data fetched from Long/LOB columns. You will need to increase this value if the total size of any long data exceeds 1 MB. The default is 1024.
DescribeAtPrepare (DAP) DescribeAtPrepare={0 | 1}. Determines whether the driver describes the SQL statement at prepare time.

When set to 0 (the initial default), the driver does not describe the SQL statement at prepare time.

EnableDescribeParam (EDP) EnableDescribeParam={0 | 1}. Determines whether the ODBC API function SQLDescribeParam is enabled, which results in all parameters being described with a data type of SQL_VARCHAR.

This attribute should be set to 1 when using Microsoft Remote Data Objects (RDO) to access data. The initial default is 0.

EnableScrollableCursors (ESC) EnableScrollableCursors={0 | 1}. Enables scrollable cursors for the data source. Both Keyset and Static cursors are enabled. The initial default is 1.
EnableStatic CursorsForLongData (ESCLD) EnableStaticCursorsForLongData={0 | 1}. Determines whether the driver supports long columns when using a static cursor. Using this attribute causes a performance penalty at the time of execution when reading long data.

The initial default is 0.

EnableTimestampWithTimezone (ETWT) EnableTimestampWithTimezone={0 | 1}. Determines whether the driver exposes timestamps with time zones to the application. When set to 1, the driver issues an "ALTER SESSION" at connection time to modify NLS_TIMESTAMP_TZ_FORMAT. NLS_TIMESTAMP_TZ_FORMAT is changed to the ODBC definition of a timestamp literal with the addition of the timezone literal: 'YYYY-MM-DD HH24:MI:SSXFF TZR'. The initial default is 0.
HostName (HOST) HostName={servername | IP_address}. Identifies the Oracle server to which you want to connect. If your network supports named servers, you can specify a host name such as Oracleserver. Otherwise, specify an IP address such as 199.226.224.34.
IANAAppCodePage (IACP) Valid values for this attribute are listed in Values for IANAAppCodePage Connection String Attribute. The code page that you specify must be the same as the code page used by your application. The driver on UNIX determines the value of the application's code page by checking for an IANAAppCodePage value in the following order:
  • In the connection string

  • In the DataSource section of the system file (odbc.ini)

  • In the ODBC section of the system file (odbc.ini)

If no IANAAppCodePage value is found, the driver uses the default value of 4 (ISO 8859-1 Latin-1).

NOTE: The IANAAppCodePage connection string attribute replaces the AppCodePage connection string attribute in earlier versions of Connect for ODBC. The drivers are backwardly compatible with the AppCodePage

LocalTimeZoneOffset (LTZO) The default for this attribute is "" (empty string). This means that the driver determines local time zone information from the operating system. If it is not available from the operating system, the driver defaults to using the setting on the Oracle server. Other possible values are specified as offsets from GMT in the following format: (-)HH:MM. For example, "-08:00" equals GMT minus 8 hours. The driver uses the value of the attribute to issue an "ALTER SESSION" for the local time zone at connect time.
LockTimeOut (LTO) LockTimeOut={0 | -1}. Determines whether Oracle should wait for a lock to be freed before raising an error when processing a Select...For Update statement.

When set to 0, Oracle does not wait.

When set to -1 (the initial default), Oracle waits forever.

LogonID (UID) The default logon ID (user name) that the application uses to connect to your Oracle database. A logon ID is required only if security is enabled on your database. If so, contact your system administrator to get your logon ID.
Password (PWD) The password that the application uses to connect to your Oracle database.
PortNumber (PORT) Identifies the port number of your Oracle listener. The initial default value is 1521. Check with your database administrator for the correct number.
ProcedureRetResults (PRR) ProcedureRetResults={0 | 1}. Determines whether the driver returns result sets from stored procedure functions.

When set to 0 (the initial default), the driver does not return result sets from stored procedures.

When set to 1, the driver returns result sets from stored procedures. When set to 1 and you execute a stored procedure that does not return result sets, you will incur a small performance penalty. For details, see Stored procedure results.

Sid (SID) The Oracle System Identifier that refers to the instance of Oracle running on the server. This item is required when connecting to servers that support more than one instance of an Oracle database.
UseCurrentSchema (UCS) UseCurrentSchema={0 | 1}. Determines whether the driver specifies only the current user when executing SQLProcedures.

When set to 0, the driver does not specify only the current user.

When set to 1 (the initial default), the call for SQLProcedures is optimized, but only procedures owned by the user are returned.


Contents Index Connecting to a Data Source Using a Logon Dialog Box Data types