Table of Contents
Configure SQuirreL SQL Client for DB2 for Linux UNIX, and Windows
At least for me the default settings for SQuirreL DB2 driver didn’t work. That’s why I documented here how to modify the default “IBM DB2 App Driver” so it works.
Configure the DB2 driver
- First I copied db2jcc4.jar from the DB2 instance. In my case the driver was under
/opt/ibm/db2/V11.1/java/ but you find it as DB2 instance user under $HOME/sqllib/java as well, since this is symlink to installation directory.
- I stored DB2 db2jcc4.jar under $HOME/Java, but you can choose a different location.
- Click Drivers tab and then double click “IBM DB2 App Driver” to modify it.
- Highlight “Extra Class Path” tab and click “Add” to add the db2jcc4.jar you have earlier stored to you computer.
- Set “Example URL” to jdbc:db2://<HOST>:<PORT>/<DATABASE_NAME>
- Set “Class Name” to com.ibm.db2.jcc.DB2Driver
Setup connection to DB2 database
- To set up your first DB2 database connection on SQuirreL SQL Client, select the “Aliases” tab and click icon, to add new database connection.
- From “Driver pull down list select “IBM DB2 App Driver”.
- Choose “Name” for you connection ie. the database name you are connecting to.
- URL is the form you set up when creating the driver: “jdbc:db2://<HOST>:<PORT>/<DATABASE_NAME>”. Set “host” and “dbname” accordingly.
No you can test your connection buy hitting test and then connect:
Ready to go
Once connection is done you can connect to DB2 database:
And start querying:
Questions?
If you have any questions or feedback, please connect with me.
How about windows?
I haven’t tried on Windows, but the driver configuration are identical. Only difference is directory structure.