Topic
  • 3 replies
  • Latest Post - ‏2009-11-17T10:59:57Z by gauravbh1
SystemAdmin
SystemAdmin
14225 Posts

Pinned topic com.ibm.db2.jcc.DB2Driver

‏2009-03-16T21:05:45Z |
hi,
i am using rad 7.0 with was 6.1. and db2 9.5.

i have a console application in a standard java project, which works within a main method.
and a web project (a little application) which has a servlet and a jsp file.

in both of them there are db2jcc.jar and db2jcc_license_cu.jar,
pdq.jar, pdqmgmt.jar files of my db2 9.5.
in both of the projects i have the same line to connect to db and to get some data:

(import com.ibm.pdq.runtime.Data;)
...
Data data = SampleUtil.getData("jdbc:db2://localhost:50000/sample",
"db2admin","***");

also i must say that i have a sampleutil.java file in both projects which defines methods for database access, like getdata above.

it works for consol application perfectly but in web application
in the same line
it says:
15.03.2009 20:59:32:937 EET 0000002b ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: SearchLoginServlet. Exception thrown : java.lang.RuntimeException: Unable to load the driver. Message com.ibm.db2.jcc.DB2Driver
what should i do? thanks

note: i have asked it in db2 forums but there is no reply yet and i think maybe it is about general developing and i wrote it here thanks
Updated on 2009-11-17T10:59:57Z at 2009-11-17T10:59:57Z by gauravbh1
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: com.ibm.db2.jcc.DB2Driver

    ‏2009-09-04T11:41:44Z  
    hello !!!
    have u found ur solution ??? i too need to connect db2 n rad by code in jsp
    it is givin exception "com.ibm.db2.jcc.DB2Driver" . do m using wrong driver ???
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: com.ibm.db2.jcc.DB2Driver

    ‏2009-10-09T15:02:32Z  
    hello !!!
    have u found ur solution ??? i too need to connect db2 n rad by code in jsp
    it is givin exception "com.ibm.db2.jcc.DB2Driver" . do m using wrong driver ???
    If you are getting an exception of "com.ibm.db2.jcc.DB2Driver", it could that the class path is not set correctly. For example, if you are running java with "-classpath", it will override your CLASSPATH environment variable and could lead to this exception.
  • gauravbh1
    gauravbh1
    8 Posts

    Re: com.ibm.db2.jcc.DB2Driver

    ‏2009-11-17T10:59:57Z  
    Do you have the db2cc.jar file inside <webProject>\WebContent\WEB-INF\lib folder?
    It should work fine if you have the jar file at this location.