// file SQLSS.zip
// jlouie 10.96

Installation:

This code implements a three tiered architecture that allows SQL query of an
ODBC compliant database over an intranet.  Lightweight, trivial encryption
of network traffic is also implemented.  Since the applet code is distributed
it would be trivial to decompile the applet and obtain the algorithm and key.
A public key, private key, random session key protocol and public algorithm
encryption protocol may be more appropriate for Internet security.

This zip archive contains source code for a middleware java socket server
application, SQLServer, and a distributed java applet front end, SQLClient.
The back end currently is a MS Access database.  The package Widgets105
is called by SQLServer.  Source and compiled code for Widgets105 is included.
A sample ODBC MS Access database is included.  The jdbc and jdbc-odbc API is
not included and must be obtained from Sun at http://java.javasoft.com.  The
Access odbc driver is included with MS Office Professional. However, the
Access odbc driver is _not_ installed by default, but must be manually
installed by drilling down to the odbc driver menu.

To summarize, the following are recommended for an intranet implementation:

Windows NT or Windows 95
A web server eg Peer Web Services (Windows NT 4.0)
Java Interpreter or virtual machine (JDK 1.02)
A MS Access database (Test.mdb)
MS Access ODBC driver
Sun's JDBC(java.sql) and JDBC-ODBC API (http:\\java.javasoft.com)

To implement this architecture one can:

Install the MS Access ODBC driver and database Test.mdb
Register the database with the ODBC driver using the 32bit ODBC control panel
Name the registered database AccessTest
Install the jdbc and jdbc-odbc API and include the path to the API in the classpath
Place the compiled code for SQLServer and the Widgets105 bytecode folder in
the classpath (eg in java\bin)
Run SQLServer (eg java\bin> java SQLServer)
Place the compiled code for SQLClient into the HTML folder of the web server
(eg InetPub\wwwroot)
Place the html file SQL.htm into the wwwroot folder and rename it ?Default.htm
Run the WebServer
Connect to the WebServer from a remote client using Netscape 2.01 (Win95).

To Log On type:

Guest <tab> Open Sesame <return>

To test the connection type:

select * from customerid
select last from customerid
select last,first from customerid where last='Duck'

To disconnect type:

exit

To kill the server:

Select Kill Server, OK.

To compile the source:

place Widgets105 bytecode folder in the destination folder
compile SQLServer.java
compile LogOnInterface.java
compile SQLClient.java

Have fun with Java,
Jeff

//=====================================================================
//
// file SQLServer.java v1.0
// see file SQLClient.java
// supplied as is, free for non-commercial use.
// synchronization is pre-beta
// jlouie 10.96
// this application implements a three tiered database access structure.
// the back end currently is a ODBC MS Access database
// SQLServer is the middleware java socket server
// SQLClient is the distributed java applet front end that executes on the client
// this code implements a trivial & lightweight XOR and ROT3 encryption.
// name this file SQLServer.java and compile with javac
// c:\java\bin>javac -d . .\src\GUIServer.java
// where the source code is in c:\java\bin\src
// and the code is compiled to c:\java\bin
// and then run it from the DOS prompt
// c:\java\bin>java GUIServer [MyDatabase] [PortNumber]
// this code was tested with Sun's JDK 1.02 for WinNT,
// Netscape 2.01 Win95/NT 4.0 over an Ethernet HP NetServer LC network
// this code does _not_ work properly with Sun's JDK 1.02 for Mac or
// earlier versions of the Win95 JDK or Netscape 3.0b4 Mac
// This application does not quit under WinNT, kill the server & then press
// ctrl-c from the dos prompt. 
// This code does not compile with J++ v1.0.
// Load the client SQL.htm file with Netscape
// or serve the client applet on a web server and log on with Netscape
//
// Ref: "Teach Yourself Java in 21 Days", Lemay & Perkins, Sams Net
// Ref: "Java in a Nutshell", David Flanagan, O'Reilly & Associates
// Ref: "Core Java", Cornell & Horstmann, Sunsoft Press
// Ref: "The Java Programming Language" Arnold & Gosling Addison Wesley
// General Ref: "Code Complete" Steve McConnell, Microsoft Press
// OOP Ref: "Obect-Oriented Analysis and Design" Grady Booch, Addison Wesley
// Encryption Ref: "Applied Cryptography" Bruce Schneier, Wiley
//=====================================================================

//=================================================================
//
// file SQLClient.java v1.0
// a Socket Server (SQLServer.java) applet client
// supplied as is, free for non-commercial use.
// synchronization is pre-beta.
// jlouie 10.96
// name this file SQLClient.java and compile with Javac eg.
// c:\java\bin>javac -d c:/MyWebServer/HTML .\src\SQLClient.java
// where the source code is in c:\java\bin\src
// and the code compiles to c:\MyWebServer\HTML
// note the use of the Unix / and DOS \ with javac!
// warning: select browser option/network/every time/apply when debugging
// with Netscape over a network!
// this applet compiles with Sun's JDK 1.02 Win95
// tested with Netscape 2.0 Win95/WinNT 4.0 over Ethernet
// does not work with Netscape 3.0b4 Mac  (Socket class)
// this applet creates a client socket that spawns 
// two threads, a socket listener and writer.
// call this class from a HTML file 
// WARNING Netscape may preferentially load any local class files on the client
// with the same name!
// Log On as User: Guest Password: Open Sesame
//
//=================================================================
