Here are the sources for an SQL client/server app that works via sockets. The server is a java application that needs to run on the same machine that the client will be downloaded from. It listens for a connection on a socket port (I picked port 6700 at random, but feel free to choose any port you like, as long as you change the value of the constant MYPORT in both the client and the server). When a connection occurs, the server accepts an SQL string from the socket, executes it, and sends the results back to the client. Conversely, the client presents a window for the user to enter SQL queries. When the user hits the "Execute" button, the client sends the SQL string to the server, receives the results from the server, and displays the results in a listbox.

Note:

This is purely a proof-of-concept application, and is not built with robustness or security in mind. There is no mechanism built in to keep users from, say, dropping all the databases in the data source that you provide. Because of this, I do not recommend that you leave the server running unattended.

The socket code was largely lifted from the O'Reilly book, "Java in a nutshell."

This applet assumes that you have installed the JDBC-ODBC bridge software on the server, and that you have a data source called "NWIND." Feel free to modify the app so that it accepts a data source name from the command line, or from the client applet. The machine running the client applet does not need any special software beyond a vanilla JVM implementation, as all the SQL processing is handled on the server.

The sources:
Source for the client
Source for the server