6 messages in com.mysql.lists.javaRE: JDBC with Java 2 and MySQL
FromSent OnAttachments
Atul Ohri18 Jun 1999 09:56 
Kolasani, Hari18 Jun 1999 10:08 
Terrence W. Zellers18 Jun 1999 10:17 
Kazys18 Jun 1999 10:35 
Atul Ohri18 Jun 1999 11:14 
Atul Ohri18 Jun 1999 11:16 
Subject:RE: JDBC with Java 2 and MySQL
From:Atul Ohri (ohr@link.law.nyu.edu)
Date:06/18/1999 11:14:01 AM
List:com.mysql.lists.java

===== Original Message From "Terrence W. Zellers" <zell@voicenet.com> ===== On Fri, 18 Jun 1999, Atul Ohri wrote:

B> I have tried all types of ways to get the driver to work, including making my

CLASSPATH the following: . (current dir) .:twz1/noopt twz1/jdbc/mysql twz1/noopt etc . . .

Currently, since I am just testing, the twz1 directory is a subdirectory off of the directory where my .java files are located. These are all the different ways I tried to get my program working:

If twz1 lies immediately beneath the current directory, then you need the current directory in CLASSPATH *after* <current-dir>/twz1/noopt. e.g. CLASSPATH=<currdir>/twz1/noopt:. Otherwise you will still be picking up the optimized classes (which jdk1.2 doesn't like) first.

-- TWZ

I had tried that before, but I tried it again and here is what I got, using DriverManager.registerDriver(DriverManager.getDriver("twz1.jdbc.mysql.jdbcMysq lDriver")); :

<dir> is my current directory

www.law.nyu.edu:<dir> % setenv CLASSPATH <dir>/twz1/noopt:. www.law.nyu.edu:<dir> % javac Connect.java www.law.nyu.edu:<dir> % java Connect -> SQLException: Message : No suitable driver SQLState : 08001 ErrorCode : 0

And the code that is producing that text is as follows: } catch(SQLException ex) { System.err.println("-> SQLException: "); while (ex != null) { System.out.println("Message : " + ex.getMessage ()); System.out.println("SQLState : " + ex.getSQLState ()); System.out.println("ErrorCode : " + ex.getErrorCode ()); ex = ex.getNextException(); System.out.println(""); } }

What could it be?