You can download the source code for the examples in the book and the solutions to the following exercises from http://www.wrox.com.
With some additional features, you'll find the InteractiveSQL utility very useful. Add the following features to InteractiveSQL:
Keep the last ten queries that were executed and allow the user to select from that list of previously run queries.
Provide a menu option that lets the user close the current connection and open a new one. Prompt the user for the URL, driver name, user name, and password.
Modify the program to provide full, detailed information about any SQLException exceptions that are thrown. You may want to use a separate window that provides more space and keeps a running list of exceptions until these are cleared by the user.
There are also lots of potential extensions to the DatabaseBrowse application. Try the following:
It would be more efficient to separate the execution of the SELECT statement from the selection events from the tree. Add a button to execute a SELECT statement with whatever table or columns are selected in the tree.
Extend the application to allow a WHERE condition to be applied. (This is quite hard. You'll need to provide an additional mechanism for specifying the WHERE conditions—which means you'll need to track the columns selected. You could keep a list that you record in the TreeSelectionEvent handler and supply a dialog to allow the condition to be specified.)
Extend the application to allow an ...