Creating and Executing a SQL Query

Create a SQL file and run it against a given database instance.

  1. Create a Java project.
    1. Select File > New > Project from the main menu bar.
    2. Select Java Project and click Next.
    3. Enter a Project Name and click Finish.
  2. Create a SQL file and associate it with a Derby connection profile.
    1. Select File > New > SQL File from the main menu bar.
    2. In the Enter or Select Parent Folder box, select the Java project you just created.
    3. Enter the File Name.
    4. Associate this SQL file with the Apache Derby connection profile by indicating the Database Server Type, Connection Profile Name, and Database Name.
  3. Click Finish.
  4. In SQL File Editor, enter the following SQL statement:

    select * from SYS.SYSTABLES

  5. Right-click in the editor and select Execute All.

    The query results appear in the SQL Results view. The left pane displays the execution history. For each statement, including stored procedures, that you run, you can create an Eclipse launch configuration. This allows you to quickly retest the execution using slightly different values and settings. You can rename or delete launch configurations as needed.