Inquirer: a Simple SQL Tester
Description and Installation

Download
Inquirer 1.0.1

(15.4 Kb)

See also Inquirer Development Tutorial

Inquirer is a simple GUI application that tests SQL statements. It was developed for the Java 1.1 Tutorial Service. Here you can find the installation procedure and a description of the application.

Installation

To use this application simply download Inquirer.zip, unzip it in a directory of your choice and open the Inquirer.bat file. Change the variables in the bat file according to your directory tree. Finally, execute Inquirer.bat.

If something goes wrong, it's important that you check the correct directories: in PATH you must add the directory where java.exe is stored, while in CLASSPATH you must put the directory you have created for Inquirer.jar (it's not a bad idea to add the path for the classes.zip of Java 1.1, too).

If the problem persists, write directly to TETRACTYS Freeware with a description of what goes wrong. For any comment or suggestion, please use the comments form

Description

Inquirer is a simple GUI application that tests SQL statements.

When you start it, a dialog appears.
This dialog has the following components:

There are four important things you must know:

  1. The connection to the database take place when the Database TEXTFIELD loses focus (for example, pressing the TAB key) and not when you press the ENTER key. If you leave the textfield unchanged, you get an exception. Every time you enter the textfield and leave it a new connection is estabilished.
  2. The java.sql.Statement method used to query the database is executeQuery. This method is used when a Statement returns a Result Set (e.g. you get a Result Set with SELECT) but no Result Set is returned by other commands (i.e. CREATE TABLE etc.). For such commands one have to use the method executeUpdate. Inquirer, created for SELECT queries only, doesn't use it, but you can still use CREATE TABLE, INSERT, DELETE etc.: the query is executed, but a warning exeception is raised.
  3. Queries are executed when you press the ENTER key on the Query TEXTFIELD.
  4. You can insert SQL statements through the buttons of the Toolbar PANEL and even column names with a simple click on the BUTTON titles of the columns.

A note regarding the returned Result Set:

The Result Set returned by a SELECT query is shown in the ScrollPane area. The columns are represented with LIST components (on the top of these LISTs you find the BUTTONS to insert column names in the Query TEXTFIELD). I have implemented a simple mechanism to link each row of a column with the corresponding one in other columns: simply you have to select an element and automatically the whole row is highlighted.

The Development Tutorial

I think that these few notes are sufficient for a correct use of Inquirer. This simple application was born to illustrate some mechanisms of JDBC and the new AWT of Java 1.1. If you are interested go to the Development Tutorial .


TETRACTYS Freeware Main Page

In the next Issue Weekly Applet will be

TEA Editor

GeoCities