3 messages in com.mysql.lists.javaRe: Can't load JDBC driver
FromSent OnAttachments
Rhino13 Dec 2003 06:44 
Chris McGowan13 Dec 2003 11:35 
Chris McGowan13 Dec 2003 13:01 
Subject:Re: Can't load JDBC driver
From:Chris McGowan (Chri@Colorado.edu)
Date:12/13/2003 01:01:52 PM
List:com.mysql.lists.java

Rhino,

From what you wrote, it sounds like you're incorrectly adding the zip file
instead of extracting the jar file within that zip. I assume that you
downloaded "mysql-connector-java-3.0.9-stable.zip" from mysql.com. Open that
zip file, and you'll find the jar, "mysql-connector-java-3.0.9-stable-bin.jar",
to include in your classpath. Add that jar, restart Eclipse, and try it again,
using the jar, not the zip.

-Chris

----- Original Message ----- From: Rhino To: Chris McGowan Sent: Saturday, December 13, 2003 1:29 PM Subject: Re: Can't load JDBC driver

I was pretty sure that wouldn't make any difference and, unfortunately, I was
right.

It may not have been clear in my original post but I am using Eclipse (Java
IDE) and it has the ability to add Jars and Zip files to the classpath
regardless of where they are in the file system. I only need to modify my build
path (Eclipse equivalent of classpath) to point to that Jar or Zip file. That's
what I did but my program isn't seeing the driver when it runs.

I tried your suggestion and put a copy of the J/Connector Zip file in my
c:\j2sdk1.4.1_02\jre\lib\ext directory but Eclipse mustn't have seen it because
I got the ClassNotFoundException again.

This is very weird because I have a slightly different version of the same
program in another package of the same project which does the same work against
a DB2 database. This program runs fine in Eclipse even though its driver was put
into the classpath in the same way, i.e. Eclipse build path -> Add External Jar.
The only difference between the programs is that the code for loading the driver
and the code for connecting to the database are slightly different due to the
differences between DB2 and MySQL.

I've even tried both programs from the command line; the DB2 version works
fine with this command: D:\eclipse\workspace\RD\bin>java -cp ".;c:\Program
Files\SQLLIB\java\db2java.zip" javadb2.Example01

The MySQL version fails on the ClassNotFoundError when I try it with this
command: D:\eclipse\workspace\RD\bin>java -cp ".;c:\Documents and Settings\Rhino\My
Documents\Downloads\mysql\mysql-connector-java-3.0.9-stable.zip" mysql.Example01

The same error occurs when I try this: D:\eclipse\workspace\RD\bin>java -cp
".;c:\j2sdk1.4.1_02\jre\lib\ext\mysql-connector-java-3.0.9-stable.zip"
mysql.Example01

If anyone can see what I'm doing wrong, I'd love to hear about it!

Rhino