JDBC-Driver ClassNotFoundException only when using JAR archive 
Author Message
 JDBC-Driver ClassNotFoundException only when using JAR archive
Hello people!

When I start my application from within a JAR archive, I get a
ClassNotFoundException while trying to load the JDBC driver with
'Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");'. When I start the
application directly with a simple 'java Foo', everything works fine.

Does anyone have an ideay what's wrong or what's missing?

Thanks
Reinhold

PS: I'm using Java 1.4.1 on WinXP with IBM DB2 7.2/FP6.



Mon, 28 Mar 2005 21:26:12 GMT
 JDBC-Driver ClassNotFoundException only when using JAR archive

Reinhold
Quote:
> Hello people!

> When I start my application from within a JAR archive, I get a
> ClassNotFoundException while trying to load the JDBC driver with
> 'Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");'. When I start the
> application directly with a simple 'java Foo', everything works fine.

> Does anyone have an ideay what's wrong or what's missing?

> Thanks
> Reinhold

> PS: I'm using Java 1.4.1 on WinXP with IBM DB2 7.2/FP6.

Did you put the actual driver into the .jar file? Or add the classpath entry
to the driver .jar into the manifest?

Thomas



Tue, 29 Mar 2005 00:42:24 GMT
 JDBC-Driver ClassNotFoundException only when using JAR archive

Quote:

> When I start my application from within a JAR archive, I get a
> ClassNotFoundException while trying to load the JDBC driver with
> 'Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");'. When I start the
> application directly with a simple 'java Foo', everything works fine.

> Does anyone have an ideay what's wrong or what's missing?

You've probably put the driver in your classpath environment variable -
which is ignored when an app is started with -jar.

--

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



Tue, 29 Mar 2005 16:24:30 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. JDBC Driver for MS Access (Not JDBC-ODBC Driver)

2. RMI-to-JDBC driver , EJB-to-JDBC driver?

3. mssqlserver.jar BETA2 JDBC drivers

4. Problems using Oracle 8.1.7 JDBC driver (classes12.zip)

5. File DSN using jdbc odbc driver

6. Using older JDBC drivers

7. using this JDBC driver ODS

8. Using jdbc:odbc drivers in a Servlet

9. Question Regarding a SQL Trace using the JDBC Driver

10. random exception using JDBC oracle driver

11. Urgent: Using Returning Into with Oracle JDBC driver

12. Using all Java JDBC Drivers with Oracle 8


 
Powered by phpBB® Forum Software