README : JDBC drivers for mysql
-------------------------------

Here is a beta release JDBC driver for the mysql database.

It is a protocol-based implementation, which means that any Java client
can access mysql over TCP/IP. It supports all the mysql types, with
username and password used for authentication (which is identical to
that used in the mysql client i.e. no password is ever sent over the
internet as clear text).

It has been tested under java and jvc (both 1.02); the JDBC is
based on the latest 1.22 release spec from Sun (which means it is
compatible with the released Java 1.1, but breaks under the earlier
alpha/betas).

Many thanks to Pratik Patel and Karl Moss for their "Java Database 
Programming with JDBC" book (http://www.coriolis.com) and to George
Reese (borg@imaginary.com) and Darryl Collins (darryl@minmet.uq.oz.au)
for their work on mSQL-JDBC and mSQL-Java, respectively. Their work
has been our education.


Steps in using JDBC to access mysql :
-------------------------------------

1. If you aren't using the release Java 1.1 jdk, then make sure you have 
   downloaded and installed the latest JDBC implementation (version 1.22).
   See http://splash.javasoft.com/jdbc/

2. Add the directory in which you unpacked this distribution to your CLASSPATH
   (or alternatively, unpack the distribution in a directory already in your
   CLASSPATH).
   e.g. (for unix)
   $ cd /usr/local/java/foreign-classes
   $ tar -xzvf ~/downloads/gweMysqlJDBC.0.9.tar.gz
   $ CLASSPATH=$CLASSPATH:/usr/local/java/foreign-classes
   $ export CLASSPATH

   (or win32)
   c:> cd /java/foreign-classes
   c:> [winzip gweMysqlJDBC.0.9.zip to above]
   c:> set CLASSPATH=%CLASSPATH%;/java/foreign-classes

3. In mysql, make sure that a separate user has been created for remote
   access over the net. The FAQ gives an example of this (you can set
   varying degrees of abilities - such as querying, inserting, deleting,
   creating, etc.)
   e.g.

   $ mysql mysql
   Welcome to the mysql monitor.  Commands ends with ; or \g.
   Type 'help' for help.

   mysql> insert into user values ('%', 'monty', password('greatsqldb'), 
   'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

	**Note** This is a very priveleged user - you should specify 'N' to
	many of the above!

4. Create the database test in mysql (if it doesen't exist already).
   e.g.

   $ mysqladmin create test

5. Create the table jdbc, and input the records (both of which are held
   in the jdbcTest.sql dump file).
   e.g.

   $ mysql test < jdbcTest.sql

6. Change the testSelect.java source file to reflect your mysql server,
   username and password.

7. Compile and run. The output should be :

JDBC SQL Query : select * from jdbc

Results : 

1 : 20000 : 8000000 : 2000000000 : 9999999999999 : 2.0000 : 3.3333 : Y : 970224123925 : This is a fixed string : This is a variable string : This is a tinyblob : This is a blob : This is a mediumblob : This is a longblob : 

r1 : 1
r2 : 20000
r3 : 8000000
r4 : 2000000000
r5 : 9999999999999
r6 : 2
r7 : 3.3333
r8 : true
r9d : 1997-02-24
r9t : 12:39:25
r9ts : 1997-02-24 12:39:25.0
r10 : This is a fixed string
r11 : This is a variable string
r12 : This is a tinyblob
r13 : This is a blob
r14 : This is a mediumblob
r15 : This is a longblob
r15 as byte array : This is a longblob

---------------1--------------

2 : 30000 : 8388607 : 2147483647 : 19999999999999 : 1.0000 : 2.3333 : N : 970224123925 : This is a second fixed string : This is a second variable string : This is a second tinyblob : This is a second blob : This is a second mediumblob : This is a second longblob : 

r1 : 2
r2 : 30000
r3 : 8388607
r4 : 2147483647
r5 : 19999999999999
r6 : 1
r7 : 2.3333
r8 : false
r9d : 1997-02-24
r9t : 12:39:25
r9ts : 1997-02-24 12:39:25.0
r10 : This is a second fixed string
r11 : This is a second variable string
r12 : This is a second tinyblob
r13 : This is a second blob
r14 : This is a second mediumblob
r15 : This is a second longblob
r15 as byte array : This is a second longblob

---------------2--------------

3 : 32767 : 6000000 : 2147483647 : 29999999999999 : 1.9000 : 1.3333 : Y : 970224123925 : This is a third fixed string : This is a third variable string : This is a third tinyblob : This is a third blob : This is a third mediumblob : This is a third longblob : 

r1 : 3
r2 : 32767
r3 : 6000000
r4 : 2147483647
r5 : 29999999999999
r6 : 1.9
r7 : 1.3333
r8 : true
r9d : 1997-02-24
r9t : 12:39:25
r9ts : 1997-02-24 12:39:25.0
r10 : This is a third fixed string
r11 : This is a third variable string
r12 : This is a third tinyblob
r13 : This is a third blob
r14 : This is a third mediumblob
r15 : This is a third longblob
r15 as byte array : This is a third longblob

---------------3--------------


...enjoy.

Bug reports to rhys@wales.com, stating which version of this driver,  
JDBC, java (version + JVM vendor), and whether or not it was a full moon.
