Summary: in this tutorial, you will learn how to interact with Db2 database servers using the SQL Developer tool.
SQL Developer is a free Database IDE that allows you to interact with databases using a graphical user interface instead of command-line tools like Db2 command line or Db2 command line plus. In the past, SQL Developer solely supported Oracle Database. However, by using third party plugins, you can use SQL developer to work with other database systems such as MySQL, SQL Server, or IBM Db2.
Download SQL Developer
Click the following link to download the SQL Developer program.
Note that you need to create an Oracle account in case you don’t have one before you can download it.
Click the following link to download the JDBC Db2 driver version:
Connect to Db2 Using SQL Developer
Launch SQL Developer and follow these steps:
Step 1. Choose Tools > Preferences… menu item:
Search for JDBC, you will find the Third Party JDBC Drivers under Database. Click the Add Entry… button
Browse to the location that you store the JDBC driver file, in this case, it is db2jcc.jar under d:\software directory. Click the Select button to choose the JDBC driver file and click the OK button to accept the JDBC driver.
Click the New button to create a connection to the Db2 database server.
Choose the database connection and click the OK button
- Click the DB2 tab
- Provide the connection details including connection name, user, password, hostname port, and the database (Books) that you want to connect.
- Click the Test button to test the connection. If you see the status: success, it shows that the connection is fine.
- Click the Save button to save the connection and then click the Connect button to connect to the Books database on the local DB2 database server.
You will see the following query editor.
Enter the following command and click the Run button, you will get the output:
In this tutorial, you have learned how to use the SQL Developer to interact with a database on the Db2 database server.