Tomcat 5.5: DB Datasource with context.xml
Explains how to define a datasource connection for your web application using context.xml
Put the following in a context.xml file inside META-INF:
<!-- Tomcat 5.5.X -- > < Context docBase="homeinventory" path="/homeinventory" debug="0" > < Resource name="jdbc/hackerdude/homeinventory" auth="Container" type="javax.sql.DataSource" driverClassName="org.gjt.mm.mysql.Driver" url="jdbc:mysql://localhost/homeinv" username="myuser" password="secret" maxActive="20" maxIdle="10" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true" maxWait="2000"/ > < /Context >
.