Configuring Data Sources
After you install the driver, you need to configure a data source or use a connection string to connect to the database. If you want to use a data source, but need to change some of its values, you can either modify it or override its values through a connection string. See "Quick Start Connect" for an explanation of different types of data sources.
If you choose to use a connection string, you must use specific connection string attributes. See "Connecting to a Data Source Using a Connection String" and Table 11-1 for a complete description of driver connection string attributes and their values.
UNIX
On UNIX and Linux, you must set up the proper ODBC environment before configuring data sources. See "Environment Configuration" for basic setup information and "Environment Variables" for more detail about this procedure.
Data sources are stored in the system information file (by default, odbc.ini). If you have a Motif GUI environment on UNIX or Linux, you can configure and modify data sources through the DataDirect ODBC Data Source Administrator for UNIX/Linux (the UNIX ODBC Administrator) using a driver Setup dialog box, as described in the following procedure. (See "Configuration Through the UNIX ODBC Administrator" for a detailed explanation of the Administrator.)
If you do not have a GUI environment, you can configure and modify data sources directly by editing the system information file and storing default connection values there. See "Configuration Through the System Information File" for detailed information about the specific steps necessary to configure a data source.
Table 11-1 lists driver connection string attributes that must be used in the system information file. Note that only the long name of the attribute can be used in the file.
Windows
On Windows, data sources are stored in the Windows Registry. You can configure and modify data sources through the ODBC Administrator using a driver Setup dialog box, as described in the following section.
Configuration
Default connection values are specified through the options on the tabs of the Setup dialog box. Connection string attributes that override these options have the same names as the options unless noted otherwise. The connection string attribute name does not have spaces between the words. For example, the option name Application Using Threads is equivalent to the connection string attribute name ApplicationUsingThreads.
NOTE: This book shows dialog box images that are specific to Windows. If you are using the drivers in the UNIX/Linux environments, the dialog box that you see may differ slightly from the Windows version. Windows-only and UNIX-only connection options are specifically noted by icons in the Setup dialog box descriptions.
By default, edit boxes and drop-down lists on the Setup dialog box are empty unless a specific default is otherwise noted.
To configure an Informix data source:
- Start the ODBC Administrator:
- Select a tab:
- User DSN: If you are configuring an existing user data source, select the data source name and click Configure to display the driver Setup dialog box.
If you are configuring a new user data source, click Add to display a list of installed drivers. Select the driver and click Finish to display the driver Setup dialog box.
System DSN: If you are configuring an existing system data source, select the data source name and click Configure to display the driver Setup dialog box.If you are configuring a new system data source, click Add to display a list of installed drivers. Select the driver and click Finish to display the driver Setup dialog box.
- File DSN: If you are configuring an existing file data source, select the data source file and click Configure to display the driver Setup dialog box.
If you are configuring a new file data source, click Add to display a list of installed drivers. Select the driver and click Advanced to specify attributes; otherwise, click Next to proceed. Specify a name for the data source and click Next. Verify the data source information; then, click Finish to display the driver Setup dialog box.
The General tab of the Setup dialog box appears by default.
NOTE: The General tab displays only fields that are required for creating a data source. The fields on all other tabs are optional, unless noted otherwise.
- On the General tab, provide the following information; then, click Apply.
Data Source Name: Type a string that identifies this Informix data source configuration. Examples include Accounting or INFORMIX-Serv1.
Description: Type an optional long description of a data source name. For example, My Accounting Database or Informix files on Server number 1.
Database Name: Type the name of the database to which you want to connect by default.
The equivalent connection string attribute is Database.
- Optionally, click the Connection tab to specify connection information. If you want to configure the data source so that the logon dialog box does not appear during connection, you must specify the connection information on this tab.
On this tab, provide any of the following optional information; then, click Apply.
Database List: Type a list of database names that will be displayed in the Logon dialog box if Get DB List From Informix on the Advanced tab is not selected. Separate multiple values with commas (for example,
db1,db2,db3).Default User Name: Type the name of the user as specified on the Informix server.
The equivalent connection string attribute is LogonID.
Use Default Login: Select this check box to read the Logon ID and Password entries directly from the Informix registry. The check box is not selected by default; that is, logon information is read from the Windows Registry, the connection string, or the Logon to Informix dialog box.Host Name: Type the name of the machine on which the Informix database resides.
Service Name: Type the name of the service as it appears in the services file on the host machine. This service is assigned by the system administrator. The name you specify appears in the Informix Server Options dialog box.The equivalent connection string attribute is Service.
Server Name: Type the name of the Informix server.
Protocol Type: Select the protocol used to communicate with the server. The possible values are: olsocspx, olsoctcp, onsocspx, onsoctcp, seipcpip, sesocspx, and sesoctcp.The equivalent connection string attribute is Protocol.
- Optionally, click the Advanced tab to specify data source settings.
On this tab, provide any of the following optional information; then, click Apply.
Cancel Detect Interval: Select a value other than 0 - None to allow long-running queries in threaded applications to be canceled if the application issues a SQLCancel. The value you select determines how often (in seconds) the driver checks whether a query has been canceled using SQLCancel. If the driver determines that SQLCancel has been issued, the query is canceled. For example, if you select 5, then for every pending query, the driver checks every five seconds to see whether the application has canceled execution of the query using SQLCancel. The default is 0, which means that queries are not canceled even if a SQLCancel is issued.
This connection option can affect performance. See "Performance Considerations" for details.
Cursor Behavior: Select Preserve (the default) to hold the cursor at the current position when the transaction ends. Otherwise, leave this field set to Close to close the cursor at the end of the transaction.
IANAAppCodePage: For a list of valid values for this option, refer to "Values for the Attribute IANAAppCodePage" in the DataDirect Connect for ODBC and Connect XE for ODBC Reference. You need to specify a value for this option if your application is not Unicode-enabled and/or if your database character set is not Unicode (refer to "Internationalization, Localization, and Unicode" in the DataDirect Connect for ODBC and Connect XE for ODBC Reference for details). The value you specify must match the database character encoding and the system locale.The Driver Manager checks for the value of IANAAppCodePage in the following order:
If no IANAAppCodePage value is found, the driver uses the default value of 4 (ISO 8859-1 Latin-1).
Cursor Behavior: Select Preserve (the default) to hold the cursor at the current position when the transaction ends. Otherwise, leave this field set to Close to close the cursor at the end of the transaction.
Application Using Threads: Select this check box to ensure that the driver works with multi-threaded applications. You can clear this check box when using the driver with single-threaded applications. Turning off this setting avoids additional processing required for ODBC thread-safety standards. By default, the check box is selected.
This connection option can affect performance. See "Performance Considerations" for details.
Enable Insert Cursors: Select this check box to enable the driver to use Insert cursors during inserts governed by parameters.
When this check box is cleared (the default), the driver does not use Insert cursors.
Get DB List From Informix: Select this check box to enable the driver to request the database list to be returned from the Informix server. When the check box is selected (the default), the driver requests the database list from the Informix server. When cleared, the driver uses the database list that the user entered on the Connection tab during driver setup.
Trim Blank From Index Name: Select this check box to trim the leading space from a system-generated index name (the default). This option is provided to address problems with applications that cannot process a leading space in index names.
Translate: Click Translate to display the Select Translator dialog box, which lists the translators specified in the ODBC Translators section of the Registry. DataDirect provides a translator named OEM to ANSI that translates your data from the IBM PC character set to the ANSI character set.Select a translator; then, click OK to close this dialog box and perform the translation.
- At any point during the configuration process, you can click Test Connect to attempt to connect to the data source using the connection properties specified in the driver Setup dialog box. A logon dialog box appears (see "Connecting to a Data Source Using a Logon Dialog Box" for details). Note that the information you enter in the logon dialog box during a test connect is not saved.
- If the driver can connect, it releases the connection and displays a "connection established" message. Click OK.
- If the driver cannot connect because of an incorrect environment or connection value, it displays an appropriate error message.
Verify that all required client software is properly installed. If it is not, you will see the message:
Specified driver could not be loaded due to system error [xxx].
Click OK.
- Click OK or Cancel. If you click OK, the values you have specified become the defaults when you connect to the data source. You can change these defaults by using this procedure to reconfigure your data source. You can override these defaults by connecting to the data source using a connection string with alternate values.