Download drivers:
https://www.ibm.com/support/pages/db2-jdbc-driver-versions-and-downloads
https://epwt-www.mybluemix.net/software/support/trial/cst/programwebsite.wss?siteId=849&h=null&p=null
https://www.ibm.com/support/pages/db2-odbc-cli-driver-download-and-installation-information#%5B%3Ch2%3E%5DDownload%5B%3C%2Fh2%3E%5D
- Copy the compressed file that contains the driver onto the target machine from the internet or a DB2 Version 9 installation CD.
- Uncompress that file into your chosen install directory on the target machine.
- cd <uncompressed driver folder>/bin
db2cli install -setup
Validate that you have the db2dsdriver.cfg file in the correct directory and that the database is registered in the Windows ODBC Administrator.
To verify where the db2dsdriver.cfg file is expected to be from the <install path>\clidriver\lib run the db2cli validate command. This will display the following:
===============================================================================
Client information for the current copy (copy name: DB2CPY11):
===============================================================================
Client Package Type : IBM Data Server ODBC & CLI Driver
Client Version (level/bit) : DB2 v11.1.1010.111 (s1610170100/64-bit)
Client Platform : NT 64BIT
Install/Instance Path : C:\PROGRA~1\CLIDRIVER
Common App Data Path : C:\ProgramData\IBM\DB2\CLIDRIVER
DB2DSDRIVER_CFG_PATH value: <not-set>
db2dsdriver.cfg Path : <Common App Data Path>\cfg\db2dsdriver.cfg
DB2CLIINIPATH value : <not-set>
db2cli.ini Path : <Common App Data Path>\cfg\db2cli.ini
db2diag.log Path : <Common App Data Path>\DB2_02\DIAG0000\db2diag.log
Note that DB2DSDRIVER_CFG_PATH and DB2CLIINIPATH are only set if the default locations are not being used.
To check if the database is correct in the db2dsdriver.cfg file execute the db2cli validate -dsn <database name>
This will show:
Keywords Valid For Value
-------------------------------------------------------------------------
DATABASE CLI,.NET,ESQL s23cv10
HOSTNAME CLI,.NET,ESQL tlba23me.torolab.ibm.com
PORT CLI,.NET,ESQL 6006
AUTHENTICATION CLI,.NET SERVER
If you don't see the driver in the Windows ODBC administrator, run db2cli install -setup
Under system data sources there will be no entries hence the reason error Data source name not
found and no default driver specified error was returned.
Resolving The Problem
Register the ODBC driver: run db2cli install -setup
Register the odbc data source: run db2cli -registerdsn -add -dsn <database name> -system