SQLManager is no "big design tool" or something the like, it is just a small tool for certain database operations. I developed it when working on Java Webapplications using Enhydra Application server and DODS (data object design studio). There it is necessary to create databases with a set of SQL statements. Sometimes errors occur and modifications in the SQL text files are not very comfortable. SQL Manager leverages for example these procedures.
(click in image for full size)



When a SELECT statement is performed, the result is converted to XML. These XML files are stored in the temporary XML directory defined in the config.xml.
When displaying the results, these XML files are read and displayed in tabular view. Hence offline browsing of SELECT results is possible. Also reuse of the XML files (representing the SELECT tables) is possible.
Download the zip file and unzip it using e.g unzip on Unix systems or winzip on Windows OSs. This help file is included in the binary distribution.
To compile the sources you need furthermore the JDOM XML parser library. You can download it from http://www.jdom.org
Download javadoc.zip (included in binary distribution)
The windows batchfile contains only one line:
java -classpath "SQLManager.jar;%CLASSPATH%" sqlmanager.SqlManager config.xml
What happens?
| Part of command String | Description |
| java | Starts Java virtual machine with parameters: |
| -classpath "SQLManager.jar;%CLASSPATH%" |
Modifys classpath: your machine classpath is added, which has two consequences: (1) All JDBC drivers already defined in your classpath will be found by SQLManager and (2) if your classpath is not correct, SQLManager will not start. Furthermore the jar (archive) file containing the SQLManager binaries will be included into the classpath. |
| sqlmanager.SqlManager | The SQLManager main class will be started with one parameter: |
| config.xml | The path and filename of the SQLManager config file. Modify eventually only this part. Add here the relativ path to the config.xml file, if you move the config file to another position. |
The config file is an XML file. However, you don´t have to know much about XML, it is pretty straightforward. Just start an texteditor, open the sample config file and add your modifications. But be aware of the following restrictions:
The sample XML file looks like this:
<SQLMANAGER>
<ApplicationOptions>
<xml_output_directory>/Java/SQLManager/out</xml_output_directory>
<xml_encoding>ISO-8859-1</xml_encoding>
</ApplicationOptions>
<SQLParserClasses>
<parser name="Basic">sqlmanager.parser.BasicDriver</parser>
<parser name="Interbase">sqlmanager.parser.InterbaseDriver</parser>
</SQLParserClasses>
<Databases>
<database connectionname="Interbase-Test">
<jdbcdriverclass>interbase.interclient.Driver</jdbcdriverclass>
<jdbcUrl>jdbc:interbase://localhost/C:\DATA\Java\SQLManager\test\SQLMAN.GDB</jdbcUrl>
<loginname>SYSDBA</loginname>
<password>masterkey</password>
</database>
<database connectionname="InstantDB-Test">
<jdbcdriverclass>org.enhydra.instantdb.jdbc.idbDriver</jdbcdriverclass>
<jdbcUrl>jdbc:idb:C:\\DATA\\Java\\SQLManager\\test\\idbTest.prp</jdbcUrl>
<loginname></loginname>
<password></password>
</database>
</Database>
</SQLMANAGER>
The config file has three sections:
Enter path to the temporary directory where the XML files are stored, that are generated for the results of SELECT statements.
Enter the encoding of the temporary XML files that are generated when a SELECT statement is performed. By default this is ISO-8859-1.
Simply add a new copy one of the sample database definition tags and enter the correct values for
| Connectionname | Arbitrary name of the database connection for you to identify the database in the GUI. Must be unique, meaning no two database connections may be named identically. |
| jdbcdriverclass | Classname of JDBC driver for this database connection. Please consult database or Java documentation. |
| jdbcUrl | URL of Database: can be "localhost" or a remote database. Please consult database or Java documentation. |
| loginname | The loginname for this database connection. |
| password | The correct password for this database connection & loginname. |
After adding new database connections you can start SQL Manager and Test each connection by selecting the connection name and selecting the menu item Database|Test Connection.
Write a new SQL Parser class and add the class file and name of the parser into this config file.
This is an advanced topic for java programmers.
Each databases have slightly different styles of SQL batch files. For example Interbase has ";" a command separator and " may not be used in the SQL statement when sent as JDBC command. Hence the SQL Parser driver for interbase detects separate statements by using the ";" as separator and removes all " from the statements.
The "basic" driver uses ";" as command separator and makes no further modification.
For writing you own driver simply perform the following steps:
| public void setSqlString (String s) | This method is called by the SQLParser class and the complete SQL statement is provided through this method. |
| public boolean hasNext() | This method is called to determine whether more SQL statements are available |
| public String next() | This method returns the nect SQL statement |
| public String sqlCommandSeparator () | This method returns the separator char(s) of this database. |
Take a look at the sqlmanager.parser.BasicDriver or sqlmanager.parser.InterbaseDriver sources for examples.
by making an entry like:
<parser name="myDriver">sqlmanager.parser.MyDriver</parser>
Be aware to either copy your driver into the sqlmanager.parser package or add the package with your drivers into the java-classpath. The driver will be loaded dynamically from SQLManager.
and override only the methods necessary. Usually these are only the methods: parseNext() and eventually sqlCommandSeparator if it is different from ";".
If you like SQLManager (or dislike it) and have further suggestions or bug reports, please send me an email.
Please contact me too if you should have written new drivers for other RDBMS products than Interbase and InstantDB or if you should have written better ones for these two, so that I can add them to the package. This is urgently needed, especially for the following systems:
Or even tell me, if the basic driver suceeds with any of them.