Configuring the Adapter for Microsoft SQL Server

In this section:

x

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


Top of page

x
Declaring Connection Attributes

How to:

Reference:

In order to connect to an Microsoft SQL Server 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 Microsoft SQL Server databases by including multiple SET CONNECTION_ATTRIBUTES commands. The actual connection to the Microsoft SQL Server takes place when the first query that references the connection is issued. If you issue multiple SET CONNECTION_ATTRIBUTES commands:



x
Procedure: How to Declare Connection Attributes

You can configure the adapter from either the Web Console or the Data Management Console.

  1. From the Web Console menu bar, click Adapters.

    or

    From the Data Management Console, expand the Adapters folder.

    The Adapters folder opens.

  2. Expand the Available folder, if it is not already expanded.
  3. 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 connection attributes reference.
  6. Click Configure. The configured adapter is added to the Adapters list in the navigation pane.


x
Reference: Connection Attributes for Microsoft SQL Server

The MS SQL Server 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.

Server (Windows only)

Name of the machine where Microsoft SQL Server is running. If that machine has more than one instance of Microsoft SQL Server installed, provide the server name and the instance name as follows: server\instance.

The server connection attribute will allow users to choose from the list of MS SQL Servers visible within the local network using the SQL Native Client Enumerator.

Please note that due to limitations of the SQL Native Client Enumerator, local network settings and MS SQL Server settings, it is possible that not all operational servers will be visible. If the name of the server you wish to target does not appear, you can enter it manually.

URL (UNIX, IBM i, and z/OS only)

Enter the location URL for the Microsoft SQL Server data source.

Security

There are three methods by which a user can be authenticated when connecting to a Microsoft SQL Server:

  • Explicit. The user ID and password are explicitly specified for each connection and passed to Microsoft SQL Server, at connection time, for authentication as a standard login.

    This option requires that SQL Server security be set to SQL Server and Windows (for Windows), or else to SQL Server and UNIX.

  • Password Passthru. (Windows only) The user ID and password received from the client application are passed to Microsoft SQL Server, at connection time, for authentication as a standard login.

    This option requires that SQL Server security be set to: SQL Server and Windows.

  • Trusted. The adapter connects to Microsoft SQL Server as an operating system login using the credentials of the operating system user impersonated by the server data access agent.

    This option works with either of the SQL Server security settings.

User

Primary authorization ID by which you are known to the data source.

Password

Password associated with the primary authorization ID.

Default Database (Windows only)

Name of the default database for the connection. This value is used when a data object is not qualified with the database name.

This parameter is optional. If not specified, it defaults to the database associated with the authorization ID.

Driver name (UNIX, IBM i, and z/OS only)

Name for the Microsoft JDBC driver.

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).



x
Syntax: How to Declare Connection Attributes Manually on Windows

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

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES [connection]
 server/userid,password [;dbname][:provider_string]

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

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES [connection]
 server/[;dbname][:provider_string]

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

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES [connection]
  server/,[;dbname][:provider_string]

where:

SQLMSS

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 Microsoft SQL Server, this parameter is optional. If not specified, the local database server serves as the default connection.

server

Is the name of the machine where Microsoft SQL Server is running. If that machine has more than one instance of Microsoft SQL Server installed, provide the server name and instance as follows: server\instance.

When specifying the server name and the instance name, we recommend that you enclose the value in single quotation marks (').

userid

Is the primary authorization ID by which you are known to Microsoft SQL Server.

password

Is the password associated with the primary authorization ID.

dbname

Is the name of the Microsoft SQL Server database used for this connection. The database name, including path, must be enclosed in single quotation marks.

provider_string

Is the Microsoft SQL Server provider string used to specify additional connection options, such as the name of the network library. Note that this parameter must be preceded by a colon and enclosed in single quotation marks. This parameter is optional.

Note: Enclose values that contain special characters in single quotation marks. If a value contains a single quotation mark, this quotation mark must be preceded by another single quotation mark, resulting in two single quotation marks in succession. For example, to specify the user ID Mary O'Brien, which contains both a blank and a single quotation mark, enter: 'Mary O' 'Brien'.



Example: Declaring Connection Attributes on Windows

The following SET CONNECTION_ATTRIBUTES command allow the application to access the Microsoft SQL Server database server named SAMPLESERVER 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.

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES SAMPLESERVER/MYUSER,PASS

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

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES SAMPLESERVER/

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

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES /,


x
Syntax: How to Declare Connection Attributes Manually on UNIX and z/OS
ENGINE SQLMSS SET CONNECTION_ATTRIBUTES CON1 'URL'/userid,password

where:

SQLMSS

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

CON1

Is the connection name.

URL

Is the URL to the location of the data source.

userid

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

password

Is the password associated with the primary authorization ID.



Example: Declaring Connection Attributes on UNIX and z/OS

The following SET CONNECTION_ATTRIBUTES command specifies using the Microsoft JDBC Driver.

ENGINE SQLMSS SET JDBCDRIVERNAME
  com.microsoft.jdbc.sqlserver.SQLServerDriver

The following SET CONNECTION_ATTRIBUTES command connects to a myServer using the Microsoft SQL Server JDBC Driver, 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.

ENGINE SQLMSS SET CONNECTION_ATTRIBUTES CON1
  'jdbc:microsoft:sqlserver://myServer:1433'MYUSER,PASS

Top of page

x
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.



x
Syntax: How to Change the Default Connection
ENGINE SQLMSS SET DEFAULT_CONNECTION connection

where:

SQLMSS

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:



Example: Selecting the Default Connection

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

ENGINE SQLMSS SET DEFAULT_CONNECTION SAMPLENAME

Top of page

x
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.



x
Syntax: How to Control the Connection Scope
ENGINE SQLMSS SET AUTODISCONNECT ON {FIN|COMMAND|COMMIT}

where:

SQLMSS

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.

COMMAND

Disconnects automatically after each request. Depending on how often the event occurs, the SET AUTODISCONNECT command may result in considerable overhead. Almost all of this overhead is not related to the server. It is related to the operating system and the data source.

COMMIT

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


iWay Software