2012-02-06

Configure Squirrel SQL to connect to IBM DB2

"Squirrel SQL" is a great light weight generic SQL client that I have started using for more than 7 years now.

This is how to configure Squirrel SQL 3.3.0 to connect to DB2 server, I have installed IBM DB2 admin client 9.7 - 64 bit software on my Windows 7 enterprise SP1. You will find two types of DB2 drivers APP & NET, most recommended way is to use type 4 JDBC driver (thin) that actually doesn't require client installation, but require proper jar files and associated license.

Steps:
1- Open Driver list from left menu, click the plus sign "Create a New Driver".
2- Type "IBM DB2 Universal Driver" in "Name" textbox.
3- Type "jdbc:db2://<server>:<port>/<dbname>" in "Example URL" textbox.
4- Type "com.ibm.db2.jcc.DB2Driver" in "Class Name" editable dropdown list.
5- Click "Extra Class Path" tab.
6- Click "Add" and select two jar files from %DB2_INSTALL%\java\db2jcc.jar & %DB2_INSTALL%\java\db2jcc_license_cu.jar
7- Click Ok, and we are done defining the driver.
8- Now create an alias for the DB using previous driver and providing URL, username, & password.

Your driver dialog should look like:


12 comments:

  1. How do you configure oracle driver for squirrel-sql-3.3.0?

    ReplyDelete
  2. Thanks for these steps. i did it :)

    ReplyDelete
  3. I get this error when I try to connect as above

    Error: DatabaseMetaData information is not known for server DB2/NTSQL09058 by this version of JDBC driver
    SQLState: null
    ErrorCode: -99999

    Do you know the reason?

    ReplyDelete
    Replies
    1. I have googled yr error, it seems some versions of DB2 client have some issues. I suggest u post yr question on IBM DB2 forum with exact versions of DB2 & Java

      Delete
    2. I am facing the same error...

      Can you help me if you found something....
      I have installed new version of squirrel-sql.

      Delete
    3. Try posting in this forum http://www.dbforums.com/db2/
      Please when you post, you need to mention exactly the following:
      1- Exact version of Operating system.
      2- Exact JDK version including (86 or 64) installed and used by SQuirrelSQL (Squirrel SQL is not your issue, i is between Java & DB2).
      3- Exact IBM DB2 client version

      Delete
  4. Thank You Ashraf Fouad....!

    It's helped me...

    ReplyDelete
  5. Hey thanks a lot. This was very very helpful

    ReplyDelete
  6. Thanks for the wonderful set of steps to configure SQuirrelSQL with DB2.

    ReplyDelete
  7. thanks for that post, v helpful

    ReplyDelete