ClassNotFoundException 
Author Message
 ClassNotFoundException

Hello,
I am a beginner with jdbc.
I tried to make an example work but i always get a
java.lang.ClassNotFoundException
I am working on suse 8.1 using jdk 1.4.0 and mysql
I read that its not necessary to put the CLASSPATH to the driver, but I
tried with and without setting it.
My Class.forName-method looks like this:
Class.forName("home.tux.java.jdbc.driver.Driver");
The path of the driver is:
/home/tux/java/jdbc/driver
I tried with the original name of the driverfile:
mysql-connector-java-2.0.14-bin.jar
and I with a renamed driverfile:
Driver.jar
but nothing works.

Can anyone help me

Harald



Fri, 15 Apr 2005 20:43:26 GMT
 ClassNotFoundException

Quote:

> I am a beginner with jdbc.
> I tried to make an example work but i always get a
> java.lang.ClassNotFoundException
> I am working on suse 8.1 using jdk 1.4.0 and mysql
> I read that its not necessary to put the CLASSPATH to the driver, but I
> tried with and without setting it.
> My Class.forName-method looks like this:
> Class.forName("home.tux.java.jdbc.driver.Driver");
> The path of the driver is:
> /home/tux/java/jdbc/driver
> I tried with the original name of the driverfile:
> mysql-connector-java-2.0.14-bin.jar
> and I with a renamed driverfile:
> Driver.jar
> but nothing works.

You still need to make sure the class *is* available, but that doesn't
necessarily mean using the CLASSPATH environment variable. I suggest
using the extensions mechanism.

See http://www.pobox.com/~skeet/java/extensions.html

--

http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too



Fri, 15 Apr 2005 16:31:57 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. ClassNotFoundException sun.jdbc.odbc.JdbcOdbcDriver

2. JDBC Connection Problem "CLASSNOTFOUNDEXCEPTION" in TomCat

3. java.sql.Clob ClassNotFoundException

4. ClassNotFoundException

5. strange ClassNotFoundException under mod_jserve

6. ClassNotFoundException

7. ClassNotFoundException is thrown in applet

8. ClassNotFoundException using oracle.pol.polp.polp

9. ClassNotFoundException

10. ClassNotFoundException

11. Servlets, Oracle drivers and ClassNotFoundException

12. java.sql.Clob ClassNotFoundException


 
Powered by phpBB® Forum Software