Here you will find a JDBC sample, test and benchmark program. I wrote it to compare two pure JAVA SQL-databases (Enydra's InstantDB and the HSQL-DB). It also demonstrates database-system independent programming. The program should work equally well with any other JDBC-enabled database.
JDBC is part of the JDK. You will find a JDBC-tutorial at http://java.sun.com.
InstantDB is available from http://instantdb.enhydra.org and HSQL-DB is available from http://hsqldb.sourceforge.net.
My sample code won't teach you JDBC, but will give you an impression how simple it is to use it.
You can download the source tarball jdbc-samples-3-src.tgz (about 17Kb). Compilation should be no problem. See the file README for details.