Configuring the Adapter for Informix

Topics:

How to:

Reference:

x

Configuring the adapter consists of specifying connection and authentication information for each of the connections you want to establish.

In order to connect to an Informix database server, the adapter requires connection and authentication information. You supply this information using the SET CONNECTION_ATTRIBUTES command. You can:

You can declare connections to more than one Informix database server by including multiple SET CONNECTION_ATTRIBUTES commands. The actual connection to Informix Server takes place when the first query that references the connection is issued. If you issue multiple SET CONNECTION_ATTRIBUTES commands:

Procedure: How to Configure an Adapter

  1. From the Web Console sidebar, click Connect to Data.

    or

    From the Data Management Console, expand the Adapters folder.

    In the DMC, the Adapters folder opens. In the Web Console, the Adapters page opens showing your configured adapters.

  2. In the Web Console, click the New Datasource button on the menu bar and find the adapter on the page or, in the DMC, expand the Available folder if it is not already expanded.
    On the Web Console, you can select a category of adapter from the drop-down list or use the search option (magnifying glass) to search for specific characters.
  3. In the DMC, expand the appropriate group folder and the specific adapter folder. The group folder is described in the connection attributes reference.
  4. Right-click the adapter name and/or version and select Configure.

    The Add Adapter to Configuration pane opens.

  5. Enter values for the parameters required by the adapter, as described in the chapter for the specific adapter you want to configure.
  6. Click Configure. The configured adapter is added to the Adapters list in the DMC resources tree or the Configured list in the Web Console.
    In the Web Console, the adapter remains on the Available Adapters list with an asterisk to indicate that at least one connection has been configured. You can configure additional connections from either the Configured or Available list by right-clicking the adapter and clicking Add Connection.

Reference: Connection Attributes for Informix

The Informix adapter is under the SQL group folder.

The following list describes the connection attributes for which you can supply values. To complete the attribute declaration, click the Configure button.

Connection name

Logical name used to identify this particular set of connection attributes. The default is CON01.

Datasource

Informix server name, as defined by the dbservername field in the sqlhosts file.

Security

There are three methods by which a user can be authenticated when connecting to a database server:

  • Explicit. The user ID and password are explicitly specified for each connection and passed to the database, at connection time, for authentication.
  • Password Passthru. The user ID and password received from the client application are passed to the database, at connection time, for authentication.
  • Trusted. The adapter connects to the database using the database rules for an impersonated process that are relevant to the current operating system.
User

Name by which the user is known to Informix.

Password

Password associated with the user name.

Database name

Informix database name. For:

  • Informix SE, specify the entire path to the location of the database files including the database name, but without the dbs extension.
  • Informix Online and Informix Dynamic Server, specify the database name, but without the dbs extension.
DB_LOCALE

Specifies the database locale, which is what the database server uses to process locale-sensitive data.

Select profile

Select a profile from the drop-down menu to indicate the level of profile in which to store the CONNECTION_ATTRIBUTES command. The global profile, edasprof.prf, is the default.

If you wish to create a new profile, either a user profile (user.prf) or a group profile if available on your platform (using the appropriate naming convention), choose New Profile from the drop-down menu and enter a name in the Profile Name field (the extension is added automatically).

Store the connection attributes in the server profile (edasprof).

Syntax: How to Declare Connection Attributes Manually

Explicit authentication. The user ID and password are explicitly specified for each connection and passed to Informix, at connection time, for authentication.

ENGINE SQLINF SET CONNECTION_ATTRIBUTES [connection]
 [datasource]/userid,password ;dbname 

Password passthru authentication. The user ID and password are explicitly specified for each connection and passed to Informix, at connection time, for authentication.

ENGINE SQLINF SET CONNECTION_ATTRIBUTES [connection]
 [datasource]/;dbname 

Trusted authentication. The adapter connects to Informix as a Windows login using the credentials of the Windows user impersonated by the server data access agent.

ENGINE SQLINF SET CONNECTION_ATTRIBUTES [connection]
 [datasource]/,;dbname 

where:

SQLINF

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.

connection

Is a logical name (or a data source name) used to identify this particular set of attributes.

If you plan to have only one connection to Informix, this parameter is optional. If not specified, the local database server serves as the default connection.

datasource

Is the name of the database server as defined by the dbservername field in the sqlhosts file.

If datasource is not specified, the Informix default server (value of the INFORMIXSERVER environment variable) is used. You can also specify the default server with two consecutive single quotation marks.

userid

Is the primary authorization ID by which you are known to Informix.

password

Is the password associated with the primary authorization ID.

dbname

Also referred to as schema, is the name of the Informix database used for this connection. For:

  • Informix SE, specify the entire path to the location of the database including the database name, but without the dbs extension. Enclose the entire value in single quotation marks.
  • Informix Online and Informix Dynamic Server, specify the database name, but without the dbs extension.

Example: Declaring Connection Attributes

The following SET CONNECTION_ATTRIBUTES command allows the application to access the Informix database mydir1/mydir2/sampdb on the Informix database server named SAMPSERVER with an explicit user ID (MYUSER) and password (PASS). To ensure security, specify connection attributes from the Web Console, which encrypts the password before adding it to the server profile.

  • For Informix SE:
    ENGINE SQLINF SET CONNECTION_ATTRIBUTES SAMPSERVER/MYUSER,PASS; 'mydir1/mydir2/sampdb'
  • For other versions of Informix:
    ENGINE SQLINF SET CONNECTION_ATTRIBUTES SAMPSERVER/MYUSER,PASS; SAMPDB

The following SET CONNECTION_ATTRIBUTES command connects to the Informix database server named SAMPLESERVER using Password Passthru authentication:

  • For Informix SE:
    ENGINE SQLINF SET CONNECTION_ATTRIBUTES SAMPSERVER/; 'mydir1/mydir2/sampdb'
  • For other versions of Informix:
    ENGINE SQLINF SET CONNECTION_ATTRIBUTES SAMPSERVER/; SAMPDB

The following SET CONNECTION_ATTRIBUTES command connects to a local Informix database server using operating system authentication:

  • For Informix SE:
    ENGINE SQLINF SET CONNECTION_ATTRIBUTES /,;'mydir1/mydir2/sampdb'
  • For other versions of Informix:
    ENGINE SQLINF SET CONNECTION_ATTRIBUTES /,; SAMPDB

Overriding the Default Connection

How to:

Once connections have been defined, the connection named in the first SET CONNECTION_ATTRIBUTES command serves as the default connection. You can override this default using the SET DEFAULT_CONNECTION command.

Syntax: How to Change the Default Connection

ENGINE SQLINF SET DEFAULT_CONNECTION connection

where:

SQLINF

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.

connection

Is the connection defined in a previously issued SET CONNECTION_ATTRIBUTES command. If this name was not previously declared, the following message is issued:

FOC1671, Command out of sequence
Note:
  • If you use the SET DEFAULT_CONNECTION command more than once, the connection name specified in the last command serves as the default connection.
  • The SET DEFAULT_CONNECTION command cannot be issued while an uncommitted transaction (LUW) is pending. In that case, the following message is issued:
    FOC1671, Command out of sequence. 

Example: Selecting the Default Connection

The following SET DEFAULT_CONNECTION command selects the database server named SAMPLE as the default database server:

ENGINE SQLINF SET DEFAULT_CONNECTION SAMPLE

Controlling the Connection Scope

How to:

The SET AUTODISCONNECT command controls the persistence of connections when using the adapter for each of the connections you want to establish.

Syntax: How to Control the Connection Scope

x
ENGINE SQLINF SET AUTODISCONNECT ON {FIN|COMMIT}

where:

SQLINF

Indicates the adapter. You can omit this value if you previously issued the SET SQLENGINE command.

FIN

Disconnects automatically only after the session has been terminated. FIN is the default value.

COMMIT

Disconnects automatically only after COMMIT or ROLLBACK is issued as a native SQL command.

WebFOCUS

Feedback