This tutorial is a basic walkthrough of the General Purpose SQL Client which is part of the swiftappj distribution.
The General Purpose WICOLOR SQL CLIENT (com.wicolor.db.gp_client) is a general purpose, interactive, JDBC(TM) based SQL client. It may be used for interactively building and maintaining SQL tables using any JDBC compliant type 4 Java(TM) driver.
NOTE:in the rest of this tutorial , the General Purpose SQL Client will be referred to as "GP_CLIENT"
The general purpose client can be used for
It also supports saving queries, setup information for several database/ driver combinations, and metadata to files the names of these files may be passed on the command line and auto loaded; this gives fairly good project management capability
The client can read a text file of SQL statements from a text file and run them in a batch mode;
SET CLASSPATH=..;.;c:\jdk1.3\jre\lib\rt.jar;c:\jars\mysql_uncomp.jar;c:\jars\swiftappj.jar;c:\jars\dg_code.jar
java com.wicolor.db.gp_client [setup-file] [utility-file] [metadata file]
NOTE:filenames may be specified as relative paths such as ../../urls.txt or full pathnames such as c:/test/urls.txt note always use forward shashes "/" instead of backslashes "\"
default_url=jdbc:mysql://localhost:3306/test up to ten additional URLs may be specified in the following form: url1=jdbc:mysql://localhost:3306/test1 url2=jdbc:mysql://localhost:3306/test2 ... url10=jdbc:mysql://localhost:3306/test10
Format is similar to URLS above
default_driver=org.gjt.mm.mysql.Driver up to ten additional Drivers may be specified in the following form: driver1=org.some_other_driver ....
cmd1=SELECT * FROM DCUST_MAST cmd2=SHOW CREATE TABLE .... cmd10=set @SOME_VAR=0
default_driver=org.gjt.mm.mysql.Driver driver1=org.gjt.mm.mysql.Driver default_url=jdbc:mysql://localhost:3306/test url1=jdbc:mysql://localhost:3306/test1 cmd1=SELECT * FROM DCUST_MAST cmd2=SHOW CREATE TABLE
output of commands such as
show tables describe_table [table_name] are logged to this fileNOTE:If contents of any of the three panels, as well as the text dump panels are changed during a session, the GP_CLIENT will prompt you to save them on exit
functions available are
This panel shows the currently selected driver and URL
You may type directly into this area, or load it from
the URL and DRIVER JComboBoxes to the right.
This panel is used for interactively executing SQL statements.
Functions are as follows:
Functions such as cut,paste,clear etc are available on the control bar just above the text area
If the executed statement returns a result set, results will be displayed in the output panel.
If an error occurs , a dialog will inform you of this, and the error will be logged to the lower part of the output panel. NOTE: you can cycle thru the editor function panels by clicking the "<" or ">" buttons at the ends of the command bar
This panel serves as a general purpose 'session log' the program prompts you to save it on exit if its contents have been modified
This panel serves as a second 'session log' the program prompts you to save it on exit if its contents have been modified
output from SHOW TABLES and describe_table [table_name] are automatically logged to this panel
This panel allows a series of SQl statements to be run as a 'batch' There is no restriction on format , except commands must be separated by ';' (semicolon) NOTE:commands must not contain embedded semicolons
This panel allows groups of
The batch update panel functions similarly to the procedure panel except:
This panel allows results from a SQL ststement which are displayed in the output panel to be manipulated in a number of different ways
Functions of controls are as follows:
The image below shows some sample output from this panel.