Developing with the pureQuery API in the workbench

The workbench provides features for writing and testing pureQuery code.

Before you begin

Ensure that your system meets the hardware and software requirements. See System requirements for Optim™ pureQuery Runtime.

About this task

You can generate pureQuery code in support of both the annotated-method and inline programming styles, including test classes and JUnit test cases. Building upon this generated code, you can develop your pureQuery code with the help of features to assist you in writing, editing, and validating SQL, in addition to the already extensive features of the Java editor.

To use the workbench to develop pureQuery code:

Procedure

  1. Optional: Create a Java project for developing your application. You can use an existing Java project if you do not want to create a new one.

    To create a new Java project:

    1. Open the Java perspective if it is not already open. Select Task Navigator > Java Database Application Development.
    2. Select File > New > Project.
    3. In the New Project wizard, select Java Project and click Next. Follow the instructions in the New Java Project wizard.
      Note: If you do not want to use the Java Runtime Environment (JRE) that is included with the workbench, you can use an IBM® or Sun JRE at version 1.5.0 or higher.
  2. Optional: Add support for pureQuery to the Java project manually.
    If you do not add this support manually, the workbench adds it the first time that you generate code.
  3. Optional: Set preferences for using the workbench to develop pureQuery code.
  4. Optional: Generate pureQuery code so that you can quickly start developing applications.
  5. Write pureQuery code from scratch. For information about the different features of the pureQuery API, see Developing pureQuery code.
  6. Write, test, and tune your SQL statements. You can use several features in the Java editor that can assist you in working with SQL.
  7. If you are using the annotated-method programming style, a DB2 database, and want your application to run SQL statically, configure support for static SQL.

Feedback