Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    21

    Unanswered: java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver

    Hi I'm developing a java project which has to do with a DB2 - JDBC connection seemingly the classpath is wreckin' it all since when launching:

    Class.forName(driverName);

    it throws
    java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver exception

    I 've set up the classpath which the way I assume it could be and no luck
    The IDE I'm using is eclipse-myeclipse
    and I just added db2java.zip to the build path
    1)placed this ZIP in WEB-INF/lib project
    2)added ZIP to classpath with add jars command

    and it really shows as an added zip but I just can't get through.
    db2java.zip is supposed to be 7.2 driver

    any Idea?

  2. #2
    Join Date
    Nov 2005
    Location
    Toronto
    Posts
    65
    can you check the following?
    LIBPATH should point to /sqllib/lib and
    LD_LIB_PATH should point to /sqllib/lib.

    and check if db2java.zip included in IBM/SQLLIB/JAVA
    and make sure you only have 1 db2java.zip in your machine
    Last edited by wangzhonnew; 11-23-05 at 16:01.
    IBM Certified DBA for DB2 UDB
    IBM Certified Database Developer for DB2 UDB
    DB2 Tech Support, IBM Toronto Software Lab

  3. #3
    Join Date
    Oct 2003
    Posts
    21
    wangzhonnew
    thanks for the quick reply.
    forgive my ignorance should I check LIBPATH in the IDE or
    in my server, either of the choice how can I do it?

  4. #4
    Join Date
    Nov 2005
    Location
    Toronto
    Posts
    65
    I guess it's IDE variable
    IBM Certified DBA for DB2 UDB
    IBM Certified Database Developer for DB2 UDB
    DB2 Tech Support, IBM Toronto Software Lab

  5. #5
    Join Date
    Oct 2003
    Posts
    21
    Ok,
    in the ide there ain't any LIBPATH variable nor LD_LIB_PATH
    however I can set them , my only doubt is :
    should they pont to the whole path
    C:Program Files\SQLLIB\lib
    or should this be a relative one?
    SQLLIB/lib
    and besides
    there is no such a folder 'lib' in
    C:Program Files\SQLLIB
    however there is only one
    db2java.zip
    in C:Program Files\SQLLIB\JAVA
    but several others in different folder eg:
    C:Program Files\SQLLIB\java\java11
    C:Program Files\SQLLIB\JAVA\java12
    C:Program Files\SQLLIB\JAVA
    ...WEB-INF\lib (which is the one I added in my project)

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by wangzhonnew
    I guess it's IDE variable
    I'm afraid your guess is incorrect. These are Unix environment variables. As we now know jicr74 runs his Eclipse on Windows, so this suggestion is not going to help.

    Back to the original question, I suggest you check the properties of the server properties or the project run properties, depending on how you execute your application. I don't think that Windows CLASSPATH setting has any effect in this case.

    I'd like to point out that the question belongs to an Eclipse support forum rather than a DB2 one since your problem is not specific to DB2.

Posting Permissions

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