Internet based Database Query Tool ================================== 1. Introduction This tool allows a user to run SQL queries from an internet browser on databases on any remote machine which is accessible from the webserver machine using JDBC. Queries may be run on any SQL database (not only Informix) that provides a JDBC driver. More information can be found at the following URL: http://www.geocities.com/sujitpal/artdb0nn.html. 2. System Requirements - Java Development Kit 1.1.7 or higher. My version is 1.1.7. - Java Servlet Development Kit 2.0 or higher (Note: if your JDK is 1.2 or higher, then JSDK is probably bundled in the JDK). My version is 2.0. - Correct version of the JDBC driver for the JDK and the database. My version is Informix JDBC 1.40.JC2. - Informix 7.x or higher or any other database that has support for TEXT data. My version is 7.30.UC8. - Java enabled browsers for the user. I use Netscape Communicator version 4.07. - Some Web server program running, such as Apache or Netscape. I use Apache version 1.3.6 (Unix). 3. Setup Information The entire tool consists of one HTML file, one SQL file, one property file and four Java files. Unload the tar file into your /tmp directory and compile them. Here are the commands: # cd /tmp # gzip -d viewer.tgz # tar xvf viewer.tar # javac VRequest.java # javac VResponse.java # javac VApplet.java # javac VServlet.java # jar cvf viewer.jar VRequest.class VResponse.class VApplet.class Next, create the database. If you plan to use an existing database, you can comment the part about CREATE DATABASE, etc. You may also want to change GRANTs to match with who should be able to connect. # dbaccess mycontroldb viewer.sql You will need to create two directories under your document directory. Thus, assuming this is /usr/local/apache/htdocs: # cd /usr/local/apache/htdocs # mkdir applets # mkdir servlets Now move the class files you created in the step above to these directories. # cp /tmp/viewer.html applets # cp /tmp/viewer.jar applets # cp /tmp/VRequest.class servlets # cp /tmp/VResponse.class servlets # cp /tmp/VServlet.class servlets # cp /tmp/servlet.properties servlets # cd $JSDK_HOME # cp bin/servletrunner /usr/local/bin # cp lib/jsdk.jar /usr/local/lib Edit the servlet.properties file to work in your environment. Replace the DBURL with one that points to your control database (vcontrol). Either add a startup script to call servletrunner on startup or modify your apache startup script to call this also. Here is a diagram of how the whole thing operates: o +---------+ +--------+ 80 +---------+ /|\ <->| Browser |<->| Applet |<---->| Web | / \ +---------+ +--------+ HTTP | Server | ^ +---------+ | | 8080 +---------+ +---------->| Servlet | HTTP | Runner | | | +---------+ +------+ ^ +--->| Ctrl | Serialized | | | DB | Objects V | +------+ +---------+ JDBC | | Servlet |<-----+ +------+ | |<--------->| Data | +---------+ JDBC | DBs | +------+