|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Java Servlet, JDBC, and IBM DB2
Hi can anyone help me get my servlet to connect to a DB2 v8.1 database. I have a java application that connects just fine to DB2 for my string url i'm using jdbc:db2:mydatabase and the driver i'm using is COM.ibm.db2.jdbc.app.DB2Driver I'm running the application on the same computer as where my DB2 is installed. Now my problem is that my servlet cant seem to make a connection of the DB i'm using the same url string and same driver (tomcat is installed on the same computer as DB2) Can someone show me how to make a proper connection or the proper driver if i'm using the wrong driver. Thanks |
|
#2
|
|||
|
|||
|
Post the code that works and the code that you are usin in the web app that does not work. Also post any error messages you are getting in the log file.
As long as the driver jar file is in WEB-INF/lib dir it should work no different than a regular java app. |
|
#3
|
||||
|
||||
|
Your using the system catalog to address the database. You can change your JDBC URL to use the hostname syntax (localhost port number) or you will have to source your sqllib/db2profile during Tomcat startup so it will know where mydatabase is.
|
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > Java Servlet, JDBC, and IBM DB2 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|