Location data | |
directory | /home/rvl2/d/asldata/ASLdatabaseSearch/server |
Main file | JDBCServer.java |
Additional files | ClientHandler.java |
Connect.java | |
JDBC connector | /home/rvl2/d/asldata/public-web/ |
mysql-connector-java-3.1.10-bin.jar | |
listening port | 7800 |
log file | /tmp/JDBCServer.out |
This server is a custom-built Java JDBC server. The server accepts connections from the applet using a simple protocol. It accesses the MySQL database through JDBC. It returns the intermediate results to the applet through the same protocol, but writes the result of the final query to a new web page. The name of the new page is then sent to the applet through the protocol.
The JDBCServer.java class creates a new ClientHandler for each request that is received, allowing multiple users to access the database at the same time. The Connect class is a small wrapper for accesses to MySQL through JDBC.
The following example illustrates the protocol used between the ASL Server and the applet client. The details of the protocol are best learned by reading the applet and server java source files, named asldbsearch.java and ClientHandler.java respectively.
Example interaction Client: SELECT Subjects.Number FROM Subjects WHERE Subjects.Number = 14 Server: 14 Server: Done Client: makeFile Client: SELECT Main.Filename, Main.CompFile FROM Main WHERE Main.LightCond = 'D' AND ( Main.Paragraph = 1 ) AND ( Main.Subject = 14 ) Server: 1637400138 Client: exit
In this example, the database returns the query results for the first query to the client. The second query is preceded by the command "makeFile", so the server creates the file and returns the ID used to create the file instead. The file's name is fileListNNNNNNN.html, where NNNNNNN is the number returned to the client. In this example, 1637400138 is the number returned, so the file's name is fileList1637400138.html.
These files are created in the directory /public-web/.