This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat 6 with MS ACCESS JNDI Relative Path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 6 with MS ACCESS JNDI Relative Path" Watch "Tomcat 6 with MS ACCESS JNDI Relative Path" New topic
Author

Tomcat 6 with MS ACCESS JNDI Relative Path

James Camire
Greenhorn

Joined: Apr 17, 2008
Posts: 1
I am trying to bundle a war file with a MS access database. Everything works great, except I can't figure out how to specify the MDB file using a relative path. This means a user will have to change the context.xml file to use it on another box. My goal is to allow a user to drop the war file onto any Tomcat app server and have it work without changes.

I've tried many variations and can't get it to work.

Thanks,

James

/META-INF/context.xml
<Context>

<Resource name="weather"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username=""
password=""
driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
url="jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=C:/Develop/webapp/MyProject/WebRoot/WEB-INF/database/weather.mdb;DriverID=22;READONLY=false}"/>

</Context>
 
Consider Paul's rocket mass heater.
 
subject: Tomcat 6 with MS ACCESS JNDI Relative Path