Jester Help

Connecting

Before you can do anything with Jester you need to connnect to a database. This can be achieved by either clicking the button at the top of the window, or by selecting File | Connect....

In either case, a Connection dialog window will be presented which allows the entry of the database connection properties:

  1. Database type - AS/400, DB2, Firebird/Interbase, Oracle, Sybase
  2. Hostname - server running the database
  3. Port - leave blank if using the default port
  4. Database name - sometimes called schema
  5. Username - may be blank
  6. Password - may be blank
At the bottom of the screen you can enter driver specific details via the Properties... button. Note that some of the database specific variable names can be accessed by right-clicking in the properties dialog.

Any new connections specified are stored in your home directory in a file called ./jester/connections.txt.

If you get a message saying that Jester cannot find the JDBC driver you need to update either your CLASSPATH or the jester.bat/jester.sh files to include the path to the driver. For instance, if trying to connect to Firebird and your JDBC driver was installed in d:\Firebird\Interclient\interclient.jar, you would add this path to the CLASSPATH variable in the startup script.

Layout

The main function of Jester is to act as a test harness and interrogation tool for stored procedures, which are displayed on the main tab. The other tabs allow entry and execution of ad-hoc queries and the retrieval of meta-data. The middle window will display any results, while the bottom window will display any status messages. The results window is only updated when data is returned from a query.

Stored Procedures

Stored Procedure definitions can either be defined in an XML source file or dynamically generated from the database itself. If this is the first time you have run Jester then you will probably need to generate the definitions by selecting Database | Get stored procedures.

Once you have got the stored procedure definitions you can select them from the list on the left and the inputs for that call will be displayed in the window on the right. Click the Call button to execute the stored procedure and display the results in the bottom window. Dates should be entered with a format of dd/mm/yyyy (or whatever is the preferred format).

Once the Call button is clicked the application will wait until the stored procedure returns or the timeout period is exceeded. If this is taking too long you can click the Cancel button to end the query prematurely. Note that the Cancel button can also be used on the Metadata and Query tabs as well.

The stored procedure definitions can be saved to an XML file which can be reloaded next time to save having to regenerate them. It can also be specified as part of the connection properties.

SQL to Java type mappings

SQL TypeJava Type
BIGINTlong
CHARjava.lang.String
DATEjava.sql.Date
DECIMALint
DOUBLEdouble
FLOATfloat
INTEGERint
LONGVARCHARjava.lang.String
NUMERICjava.math.BigDecimal
SMALLINTshort
TIMEjava.sql.Time
TIMESTAMPjava.sql.Timestamp
TINYINTbyte
VARCHARjava.lang.String
Any numeric values are entered as numbers and validated according to the Java types. They are then converted to the appropriate SQL type before being submitted to a stored procedure.

The other types are entered as alphanumeric strings and converted to the appropriate SQL type before being submitted to a stored procedure.

Default values

If you enter a value for an input parameter this will be remembered as a default value stored against the parameter description. So if you have an input parameter with a description of Customer reference, next time you view a stored procedure which has a parameter description of Customer reference it will be defaulted to the previously entered value.

Note that if you have just used the Get stored procedures function and there are a lot of CHAR input parameters then all stored procedure parameters with a type of CHAR will default to the same value. This can be overcome by editing the parameters to give them meaningful descriptions.

Queries

Enter an ad-hoc query and click the Execute button to display the results, e.g. select * from table1. The last 15 queries are stored in a history list at the top of the text area. You can also save and load SQL scripts.

Meta-data

Select either tables or procedures to see available entries in the database. The schema filter defaults to the database name, but is only applied if the database supports schemas in table or procedure definitions.

Note that selecting a stored procedure or table will display more detailed information.

Table info

When viewing table info, primary key fields are indicated with an asterisk.

Results table

The results table displays the response from all stored procedure, ad-hoc and meta-data queries. You can click on a cell to display a popup menu which will allow you to copy the cell's contents to either the clipboard or one of the stored procedure inputs.

Printing

To print the results table, select File | Print....

Preferences

Preferences for date and time format and query timeout can be set from the Preferences menu. Date and time formats only apply to input parameters, output parameters are automatically converted to Strings using the client platforms' defaults.

Saving results

You can save the results table as comma separated values (CSV) by selecting File | Save as CSV.

Shortcuts

KeyShortcut
Ctrl-Alt-COpen a connection to a database
Ctrl-DDisconnect from database
Ctrl-GGet stored procedures
Ctrl-HDisplay help
Ctrl-LLoad a stored procedure definition file
Ctrl-PPrint the results table
Ctrl-SSave data as a CSV file
Ctrl-Alt-SSave stored procedures to a definition file
Ctrl-EExit

JDBC Drivers

JDBC drivers for your database can be downloaded at the following locations:
DatabaseURL
AS/400http://oss.software.ibm.com/developerworks/projects/jt400
DB2Included with DB2
Firebird/Interbasehttp://www.ibphoenix.com/ibp_download.html#INTERCLIENT
Oraclehttp://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html
Sybasehttp://my.sybase.com/detail?id=1009796

Nick Sydenham <nsydenham@yahoo.co.uk>