Java Tutorial CoffeeBreak Example
This directory contains working MySQL examples from Mydene Fisher's JDBC Basics Tutorial. (local PASSWORD protected copy).
You can consult SUN's full Java tutorial at http://java.sun.com/docs/books/tutorial/ (even download it).
Example Files / Directories
Java Applications (Simple Connect /Drop /Create/Query)
Examples in the simple directory are
Java Applications. You need to download them to YOUR site AND you need to install
the MySQL JDBC Driver(s).
Simple connection test with Twz1 Driver - old, not maintained example
Simple connection test with MM Driver - revised 2/2000
Simple drop/create test with Twz1 Driver - old, not maintained example
Simple drop/create test with MM Driver (warning username & password removed - revised 2/2000
Simple insert test with MM Driver - revised 2/2000
Simple insert test with MM Driver - wrongly imports MySQL Driver classes, works but needs type casting.
Simple query test with MM Driver - revised 2/2000
*.ORI: Originals from the Tutorial files
The example in the simple-applet directory is working,
but see the README.html for security. This applet does a simple canned
The examples in the simple-query-applet directory implement a simple query /update text windows where you can type in SQL expressions and watch the result.
An running example servlet is at
http://tecfa.unige.ch/guides/java/staf2x/ex/servlet/CoffeeBreakServlet (and on other java servers at Tecfa maybe)
and the source is at
It does more or less the same thing as the applet examples (however I wouldn't program it
this way anymore ....)
Currently (1/99) only mm and twz1 seem to be popular. Both drivers have been
tested with some examples. Other examples only use the MM Driver. I chose to
work with MM because it claims to be faster, the author distributes
a jar archive, it's GPL, the API doc looks fancier. Well let's say it was
more or less randomly done :)
Tecfa Users: Classes are in /local/java/classes/xxx..
See ALSO: SUN's java.sql API doc (local password protected). You get
this page from your own JDK API doc.
No suitable driver error message
It took me few hours to get the examples going. What was particular bad
was the following totally inappropriate SQLException message:
==> SQLException: No suitable driver
Message: No suitable driver
This is the result from a BAD URL and has IMHO nothing to do with the driver.
String url = "jdbc:mysql:tecfa2.unige.ch:3306/COFFEEBREAK";
String url = "jdbc:mysql://tecfa2.unige.ch:3306/COFFEEBREAK";
I am a newbie Java/Mysql/JDCB/... programmer.
Goto: http://tecfa.unige.ch/guides/mysql/ * http://tecfa.unige.ch/guides/java/pointers.html