Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Unanswered: 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!

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    The "app" driver is deprecated. Use com.ibm.db2.jcc.DB2Driver

  3. #3
    Join Date
    Jun 2010
    Posts
    2
    Sorry, but with "new" "com.ibm.db2.jcc.DB2Driver" is the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •