Driver packages in Watson Query
The Watson Query driver package contains software for connecting client applications to a Watson Query instance.
The driver package contains client interface tools, such as CLPPlus. The driver package also contains the following drivers:
- JDBC
- Node.js
- Ruby
- ODBC
- CLI
- .Net
- OLE DB
Already installed?
To verify that the driver package is already on your computer so that you can skip installing it again, or to determine the version number, you can use the db2level command.
Downloading the driver package
You can download the driver package for your operating system from the Watson Query web console. From your IBM® Cloud dashboard, open your Watson Query service. Log in to your Watson Query web console.
In the Watson Query web console, select Connect details. Select the tile that represents your operating system to download the appropriate driver.
Installing
Install the driver package for your operating system.
Configuring your local environment
To connect local applications and tools to your Db2® on Cloud database, you must configure your environment.
Before you try to connect to your Watson Query instance, verify that you have the prerequisites.
- Add entries to the driver configuration file,
db2dsdriver.cfg
, for your database. The configuration steps are different depending on whether you want to connect to your database by using SSL.- With SSL
- To connect your applications and tools to your database by using SSL, enter the following
commands in a command shell on Linux operating
systems, at the Windows command prompt, or
in a Db2 command window.
db2cli writecfg add -database BLUDB -host <hostname> -port <port> db2cli writecfg add -dsn <alias> -database BLUDB -host <hostname> -port <port> db2cli writecfg add -database BLUDB -host <hostname> -port <port> -parameter "SecurityTransportMode=SSL"
Where
<hostname>
is the hostname of your server.<alias>
is an alias that you choose. The alias cannot be the same as the database name,BLUDB
. If you want to have spaces in the alias, surround the alias with double quotation marks.<port>
is the port number that is assigned to your server.
- Without SSL
- To connect your applications and tools to your database without using SSL, enter the following
commands in a command shell on Linux operating
systems, at the Windows command prompt, or
in a Db2 command
window.
db2cli writecfg add -database BLUDB -host <hostname> -port <port> db2cli writecfg add -dsn <alias> -database BLUDB -host <hostname> -port <port>
Where
<hostname>
is the hostname of your server.<alias>
is an alias that you choose. The alias cannot be the same as the database name,BLUDB
. If you want to have spaces in the alias, surround the alias with double quotation marks.<port>
is the port number that is assigned to your server.
- Test the connection by running the db2cli validate
command.
db2cli validate -dsn <alias> -connect -user <userid> -passwd <password>
Where
<alias>
is an alias that you created with the db2cli writecfg command.<userid>
is your Db2 user ID.<password>
is your Db2 password.
- If you want to connect local ODBC applications and tools to your database, register the DSN with
the ODBC driver manager by running the following
command.
db2cli registerdsn -add -dsn <alias>
Where
<alias>
is an alias that you created with the db2cli writecfg command.
By default, the DSN is created as a user DSN.