If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Help!!! : java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-10-10, 07:56
niksmv niksmv is offline
Registered User
 
Join Date: Jun 2010
Posts: 2
Help!!! : java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

Sorry for my English.

I try to work with IBM DB2 Express C v. 9.7 on Windows ( Vista )

But in Java I am novice.

In the NetBeans 6.8 I create new Java Application project.

My code is:

package db2test1;

import java.sql.*;

public class Main {

public static void main(String[] args)
{
try
{
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
}
catch( ClassNotFoundException e )
{
System.err.println("Could not load DB2 driver! \n");
e.printStackTrace();
System.exit(1);
}

// ...

return 0
}
}

But I can't load driver needed. In any case a get:

java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
at java.net.URLClassLoader$1****n(URLClassLoader.java :202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at db2test1.Main.main(Main.java:31)

My CLASSPATH is:

.;C:\IBM\SQLLIB\java\db2java.zip;C:\IBM\SQLLIB\jav a\db2jcc.jar;C:\IBM\SQLLIB\java\sqlj.zip;C:\IBM\SQ LLIB\java\db2jcc_license_cu.jar;C:\IBM\SQLLIB\bin; C:\IBM\SQLLIB\java\common.jar

Where is my error?

Help me please!
Reply With Quote
  #2 (permalink)  
Old 06-10-10, 12:08
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
The "app" driver is deprecated. Use com.ibm.db2.jcc.DB2Driver
Reply With Quote
  #3 (permalink)  
Old 06-11-10, 01:06
niksmv niksmv is offline
Registered User
 
Join Date: Jun 2010
Posts: 2
Sorry, but with "new" "com.ibm.db2.jcc.DB2Driver" is the same.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On