Last Update: 27 February 2008
Product: StarSQL
Versions: 5.x
Article ID: SQV00SQ036
This technical document describes how to create a StarSQL connection to DB2 that does not use a data source name (DSN). This type of connection is known as a DSN-less connection. The use of DSN-less connections eliminates the need to create ODBC DSNs in order to access the database server.
A DSN-less connection string must contain all of the required connection parameters in order for StarSQL to connect to the DB2 system. The parameters that are required for TCP/IP connections differ from those required for SNA connections. The following table lists the required parameters for TCP/IP and SNA connections, respectively. Sample connection strings for both types of connections are provided later in the document.
The examples provided with this solution work with applications that use Microsoft RDO, ADO/RDS, and ODBC.NET data access technologies.
| Parameter
Name |
Description |
| Driver |
This value must be set to {StarSQL 32}. |
| Server |
This value corresponds to the
Database Server Name in a StarSQL DSN.
|
| NetLib | This value must be set to SWTCP32.DLL. |
| HostName |
The host name refers to the TCP/IP server, which is the same as the host name of the database server. Use either a TCP/IP host name or an IP address in dotted decimal notation. |
| UID |
Enter your username or authorization identifier for connecting to the database. |
| PWD |
Enter your password for connecting to the database. |
| Parameter Name | Description |
| Driver | This value must be set to {StarSQL 32}. |
| Server | This value corresponds to the
Database Server Name in a StarSQL DSN.
|
| NetLib | This value must be set to SWAPPCNT.DLL. |
| LocalLU |
Specify the name of the local LU. |
| RemoteLU |
Specify the name of the remote LU. |
| ModeName |
Specify the mode name for the SNA session. |
| UID | Enter your username or authorization identifier for connecting to the database. |
| PWD | Enter your password for connecting to the database. |
There are many optional parameters that may be specified in a DSN-less connection string. To view a complete list of the available parameters and the valid values, create a StarSQL System or User DSN using the ODBC Data Source Administrator and review the Data Source Entry list on the Expert Page panel. With this panel active, click Help to display the topic that describes the optional parameters.
Following are some of the most commonly-used optional parameters:
| Parameter Name | Description |
| PkgColId | Enter the location on the DB2 host of the packages required by StarSQL to execute Dynamic SQL. The default is STARSQL. |
| Port | This parameter is only used for TCP/IP connections. The default is 446. Set this value only if your DB2 system listens for requests on a port other than 446. |
| CatFilters | For the Catalog Filters you can select one or more (up to ten) qualifiers to restrict the amount of data retrieved by ODBC. Each filter must be within single quotes and separated by a comma, such as 'QAUSER','PRODUSER'. |
Parameters that are not specified in the connection string use default values. Refer to the StarSQL Help for the default values that are used for the optional parameters.
To construct a DSN-less connection string, create a string that contains the required and optional parameters with their appropriate values, each in the format of parameter=value. Each parameter=value pair must be separated by a semi-colon as shown in the below examples.
The following string will work with RDO, ADO/RDS, and ODBC.NET. Use the Provider parameter only with ADO or RDS connections.
"Driver={StarSQL 32};Provider=MSDASQL;Server=DB2PROD;NetLib=SWTCP32.DLL;Server=DB2PROD;HostName=db2host.company.com;Port=7446;PkgColID=STARSQL53;UID=db2user;PWD=secret"
The following string will work with RDO, ADO/RDS, and ODBC.NET. Use the Provider parameter only with ADO or RDS connections.
"Driver={StarSQL 32};Provider=MSDASQL;Server=DB2PROD;NetLib=SWAPPCNT.DLL;LocalLU=MYSYS;RemoteLU=DB2PROD;ModeName=LU62STAR;CatFilters='QAUSER';UID=db2user;PWD=secret"
The information in technical documents comes without any warranty. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The information in technical documents may be gathered from various sources, including IBM, Microsoft, and other organizations.