devloop icon
Metastores

Tomcat Connection Setup

This method is very simple as it folllows the standard Tomcat JNDI configuration for the data source.

Here is an example of a MySQL data source configured for a specific context:

<Context path="/DBTest" docBase="DBTest"
		debug="5" reloadable="true" crossContext="true">

	<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="10000"
               username="user" password="pwd" driverClassName="com.mysql.jdbc.Driver"
               url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
</Context>

What this does is make the data source available to the web application /DBTest under the name "jdbc/TestDB".

Next you must tell mts to use this JNDI name as its default data source.

Quick Links