Enabling pureQuery support in the workbench requires both
a Java project and a database
connection. You can create the project and connection in any order.
This tutorial assumes that workbench starts with the IBM SQL and Routine Development
perspective and the default set of views.
You create a connection
to the SAMPLE database in the workbench with the SQL and Routine Development
perspective. Then you switch to the Java perspective
and create a Java project. The
connection to the database is needed when you enable pureQuery support
for the project.
To create a database connection and Java project:
- Start IBM Data Studio.
The workbench opens the IBM SQL
and Routine Development perspective.
- Create a connection to the SAMPLE database.
- In the Data Source Explorer window,
right-click the Database Connections folder
and select New.
- Follow the steps in the wizard to create a connection
to your instance of the SAMPLE database.
In
Connection
Parameters, select the following to create a DB2® connection:
- In the Select a database manager field field,
select DB2 for Linux, UNIX, and Windows.
- In the JDBC driver field, select IBM
Data Server Driver for JDBC and SQLJ (JDBC 4.0) Default.
- Switch to the Java perspective.
Click .
The Java perspective opens. This tutorial assumes
that you are working with the default Java perspective.
Notice
the two tabs in the upper left part of the Java perspective: the Package Explorer and
the Hierarchy tabs:
Figure 1. The Package
Explorer and the Hierarchy tabs
- If the Task Launcher view is open,
close it.
Click the X on the
Task Launcher tab.
- Create a Java project.
- Right-click in the Package Explorer and
select .
The New Java Project wizard opens.
- Type pq-tutorial in the Project
name field at the top of the wizard. Leave the rest of
the options at their default values.
- Click Finish.
IBM Data Studio
creates your Java project. You
see the pq-tutorial project in the Package Explorer.
Figure 2. The pureQuery_test Java project
in the Package Explorer