The applet shown below can be used to access an InstantDB database. Clicking on the Browse button allows you to navigate to any InstantDB properties file. Once the required file has been selected, click on connect

The Results list initially shows some of the Java virtual machine's system properties. This can be useful for debugging. By clicking on any of the tables on the left, a SELECT * FROM table SQL string can be automatically generated. Clicking on Submit will execute the SQL statement. The label on the results list changes to the column headings, and the results list gets populated from the rows returned.

Sometimes a row can be too large to be properly displayed in the results list, and not all JVM's provide a horizontal scroll bar. By clicking on a row in the results list, it will be added to the text area below. Once there it can be freely edited.



The Get Rows button is an HTML form button. When clicked it invokes a small JavaScript function which outputs the results list to the screen. More sophisticated forms could repeatedly call a JavaScript function in order to retrieve individual rows and populate a Form Selection or an HTML table.

Javascript has access to all of the Java applet's public properties and methods. All Javascript has to do is to invoke the Java methods as if they were Javascript objects.

The Get Rows button is there for a good reason. We could simply attempt to load the applet and then run a script immediately. However, current browsers do not seem to wait for the applet to initialise before proceeding with the script. The result is that the script can't find the various applet methods that it needs to invoke.

Extracting the data from the applet and accessing it via Javascript seems to work on most of the current generation of browsers. However, getting the applet to successfully access the database is dependent on the security manager. Some browsers will require signed applets in order to do this. Consult your browser's documentation for details.

The applet can be run outside a browser. The class JDBCmain provides a main method and creates a Frame for the applet to run in.

There are lots of ways all this could be improved. As well as table navigation, column navigation could be added. The tool could then be used as a primitive SQL builder. A row limit would also be handy, as would an automatic SELECT count(*) FROM table when a table was selected.