DB2 Tutorial

  • Home
  • Start Here
  • Basics
  • Views
  • Triggers
  • Indexes
  • Functions
    • Aggregate Functions
    • Date Functions
    • String Functions
    • Window Functions
Home » Getting Started with Db2 » Using SQL Developer to Interact with Db2

Using SQL Developer to Interact with Db2

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.

Download SQL Developer

Note that you need to create an Oracle account in case you don’t have one before you can download it.

Download Plugin

Click the following link to download the JDBC Db2 driver version:

Download JDBC DB2 driver

Connect to Db2 Using SQL Developer

Launch SQL Developer and follow these steps:

Step 1. Choose Tools > Preferences… menu item:

Step 2

Search for JDBC, you will find the Third Party JDBC Drivers under Database. Click the Add Entry… button

Step 3

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.

Step 4

Click the New button to create a connection to the Db2 database server.

Step 6

Choose the database connection and click the OK button

Step 7

  1. Click the DB2 tab
  2. Provide the connection details including connection name, user, password, hostname port, and the database (Books) that you want to connect.
  3. Click the Test button to test the connection. If you see the status: success, it shows that the connection is fine.
  4. 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.

Step 8

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.

  • Was this tutorial helpful ?
  • YesNo
Previous Connecting to a Database in Db2 Database Server

Getting Started

  • What is Db2
  • Installing Db2 Database Server
  • Db2 Sample Database
  • Creating a Db2 Sample Database
  • Connecting to a Db2 Database
  • Interacting with Db2 using SQL Developer

Data Manipulation

  • SELECT
  • ORDER BY
  • WHERE
  • SELECT DISTINCT
  • AND
  • OR
  • BETWEEN
  • LIKE
  • IN
  • LIMIT
  • FETCH
  • Join
  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL OUTER JOIN
  • Self-Join
  • CROSS JOIN
  • GROUP BY
  • Subquery
  • HAVING
  • UNION
  • INTERSECT
  • EXCEPT
  • Common Table Expression or CTE
  • INSERT
  • INSERT Multiple Rows
  • INSERT INTO SELECT
  • UPDATE
  • DELETE

Managing Database Objects

  • CREATE TABLE
  • Identity Columns
  • ALTER COLUMN
  • ADD COLUMN
  • DROP COLUMN
  • DROP TABLE
  • TRUNCATE TABLE
  • RENAME TABLE

Db2 Constraints

  • Primary Key
  • Foreign Key
  • DEFAULT
  • NOT NULL
  • CHECK
  • UNIQUE

Db2 Data Types

  • Integer
  • Decimal
  • VARCHAR
  • CHAR
  • DATE
  • TIME
  • TIMESTAMP

Useful Functions & Expressions

  • CAST
  • CASE Expression
  • COALESCE

About db2tutorial.com

The db2tutorial.com website provides you with a comprehensive IBM DB2 tutorial with many practical examples and hands-on sessions.

Recent Tutorials

  • Db2 Functions
  • Db2 RANK
  • Db2 ROW_NUMBER
  • Db2 Window Functions
  • What is Db2

Site Links

  • Home
  • About Us
  • Contact Us
  • Privacy Policy
Copyright © © 2021 by www.db2tutorial.com. All Rights Reserved.