JDBC set up in Tomcat with DB2 database, eclipse IDE
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   MKumar_Sankar
Posted On:   Monday, March 17, 2003 03:59 AM

Hi all I am new to Tomcat. I am using Tomcat4.1 with Eclipse 2.1. I am trying to set up JDBC connection with DB2 using 4 type driver (DataSource I am using is COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource). I have the following resource configuration in server.xml file in /conf/server.xml file validationQuery maxWait 5000 maxActive 4 password mypass url jdbc:db2://cauvery:6789/P3_WAS40 driverClassName COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource maxIdle 2 username myuser And I have inserted th   More>>

Hi all
I am new to Tomcat. I am using Tomcat4.1 with Eclipse 2.1. I am trying to set up JDBC connection with DB2 using 4 type driver (DataSource I am using is COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource).
I have the following resource configuration in server.xml file in /conf/server.xml file

			




validationQuery



maxWait
5000


maxActive
4


password
mypass


url
jdbc:db2://cauvery:6789/P3_WAS40


driverClassName
COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource


maxIdle
2


username
myuser




And I have inserted the following entry in application specific web.xml file

			

jdbc/MyDataSource
javax.sql.DataSource
Container


When I try to access through my JSP by looking up new InitialContext().lookup("java:comp/env/jdbc/MyDataSource"), I am able to lookup but then when I try to call getConnection on that, it is reporting that the driverClassName is null. What might be the problem.
I am placing my DB2 driver zip file in /common/lib folder. Is this the correct place?

Another thing I observed is, when I place a resource-ref in web.xml file, the Tomcat administration console is unable to show my datasource. It is also stating that driverClassName is null.
But when I remove my entry from my application specific web.xml file, then it is displaying the datasource properly in administration console. But I am unable to look up from my JSP page. It is reporting that, "Name MyDataSource is not bind in this context".    <<Less
About | Sitemap | Contact