|
|
Q: How can I create a JDBC Data Source on Tomcat?
A: Here are the steps for creating a Data Source on Tomcat:
1. In Tomcat's context.xml file (/conf/context.xml),
add a line similar to the following:
2. In Tomcat's server.xml file (/conf/server.xml,
add the following XML snippet to the node:
type="javax.sql.DataSource"
password="welcome"
driverClassName="com.ibm.db2.jcc.DB2Driver"
maxIdle="2" maxWait="5000"
validationQuery="select * from qauser.employee"
username="qauser"
url="jdbc:db2://qadb2v8:50000/QADATA"
maxActive="4" />
3. In Tomcat's common/lib directory, add the JDBC driver
JARs (for DB2 v8.x or 9.x, these are db2jcc.jar, db2jcc_license_cu.jar,
and
db2jcc_license_cisuz.jar). If connecting to DB2 v7, use the db2java.jar
driver instead.
You actually only need one of those license JARs. The "cu"
JAR is for windows, the "cisuz" JAR is for UNIX, etc.
|