Friday, December 3, 2010

JNDI datasource

The following resource need to put into an context element. The default Tomcat has $CATALINA-HOME/conf/context.xml, so the resource can be put into that file.



< resource auth="Container" driverclassname="com.mysql.jdbc.Driver" maxactive="100" maxidle="30" maxwait="10000" name="jdbc/TestDB" password="testTwo" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/testDb/testTable" username="testTwo">

And in web.xml:

No comments:

Post a Comment