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:
- Database type - AS/400, DB2, Firebird/Interbase, Oracle, Sybase
- Hostname - server running the database
- Port - leave blank if using the default port
- Database name - sometimes called schema
- Username - may be blank
- 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 Type | Java Type |
BIGINT | long |
CHAR | java.lang.String |
DATE | java.sql.Date |
DECIMAL | int |
DOUBLE | double |
FLOAT | float |
INTEGER | int |
LONGVARCHAR | java.lang.String |
NUMERIC | java.math.BigDecimal |
SMALLINT | short |
TIME | java.sql.Time |
TIMESTAMP | java.sql.Timestamp |
TINYINT | byte |
VARCHAR | java.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
Key | Shortcut |
Ctrl-Alt-C | Open a connection to a database |
Ctrl-D | Disconnect from database |
Ctrl-G | Get stored procedures |
Ctrl-H | Display help |
Ctrl-L | Load a stored procedure definition file |
Ctrl-P | Print the results table |
Ctrl-S | Save data as a CSV file |
Ctrl-Alt-S | Save stored procedures to a definition file |
Ctrl-E | Exit |
JDBC Drivers
JDBC drivers for your database can be downloaded at the following locations:
Nick Sydenham <nsydenham@yahoo.co.uk>