Rational Application Developer 7.0 offers a wide range of tools to work effectively with relational databases. In this article, you will learn how to establish a database connection, set up a data development project, and work with SQL Builder.
Before any development can begin, a database connection must be established. You will use Derby 10.1 as your sample database. RAD 7.0 comes with the derby.jar file (see the com.ibm.datatools.db2.cloudscape plug-in). In case you want to download a newer version, you can do so by going to http://incubator.apache.org/derby/.
Follow these steps to create a Derby connection:
Figure 1: Data Perspective
Figure 2: Open New Connection Dialog
Figure 3: Set up and test Derby Connection
Now that you have created a database connection, you can move ahead to create a Data Development Project.
A Data Development Project is required to develop the following types of objects:
Figure 4: Data Development Project
SQL Builder is a wizard/tool that allows you to create SQL Statements interactively. Please go through an exercise where you join two tables in a simple select.
Figure 5: Create new SQL Statement
Figure 6: New SQL Statement
Once the SQL Statement file is created, you can start building your SQL Statement.
Figure 7: Open Table List
Figure 8: The EMPLOYEE and EMP_PHOTO tables are selected
Figure 9: Create an Inner join between EMPLOYEE and EMP_PHOTO
Figure 10: Add Where Clause
Figure 11: View Execution Results in the Data Output Pane
In this article, you have learned how to create a database connection and use SQL Builder using RAD 7. In the next article, you will learn how to create SQL Stored Procedures and User-Defined Functions using RAD.
Aleksey Shevchenko has been working with object-oriented languages for over eight years. For the past four years, he has served as a technical lead and a project manager. Aleksey has been implementing Enterprise IT Solutions for Wall Street and the manufacturing and publishing industries.