User ID/password authentication
- Last Updated: August 25, 2023
- 2 minute read
- DataDirect Connectors
- ODBC
- IBM Db2 8.0
- Documentation
The driver supports the User ID/password
authentication. It authenticates the user to the database using a user name and
password.
Important: The procedure given in this section uses the user ID/password authentication
without encryption. To use it with encryption, set the Authentication Method option to one
of the following values:
1 (Encrypt Password), 2 (Encrypt UID and Password), 7 (Encrypted Password AES), and 8 (Encrypted
UID and Password AES). See "Authentication Method" for details.To configure the driver to use user ID/password (no encryption) authentication:
- Set the IP Address (IPAddress) option to specify the host name or the IP address of the machine where catalog tables are stored.
- Set the TCP Port (TCPPort) option to specify the port number that is assigned to the Db2 DRDA listener process on the server host machine.
- Set the Database Name (Database) option to specify the name of the database to which you want to connect. Valid only on Db2 for Linux, UNIX, and Windows; Db2 Hosted; and Db2 Warehouse on Cloud.
- Set the Location Name (Location) option to specify the name of the Db2 location that you want to access. Valid only on Db2 for z/OS and Db2 for i.
- Set the Collection option to specify the current collection or library. Valid only on Db2 for z/OS and Db2 for i.
- Set the User Name (LogonID) option to specify your user name.
- Set the Password option to specify your password.
The following examples show the connection information required to connect to Db2 for Linux, UNIX, and Windows using user ID/password (no encryption) authentication.
Connection string
DRIVER=DataDirect 8.0 Db2 Wire Protocol;IPAddress=localhost;TCPPort=50000;
Database=db2data;LogonID=jsmith;Password=secret;
odbc.ini
[Db2]
Driver=ODBCHOME/lib/xxdb228.yy
...
IPAddress=localhost
...
TCPPort=50000
...
Database=db2data
...
LogonID=John
...
Password=secret
...
Note: The User and Password options are not required to be stored in the data source. They can
also be sent separately by the application using the SQLConnect ODBC API. For SQLDriverConnect
and SQLBrowseConnect, they will need to be specified in the data source or connection
string.