在server.xml文件中: < GlobalNamingResources > < Resource name ="jdbc/GLOBAL_DEMO" auth ="Container" type ="javax.sql.DataSource" maxActive ="20" maxIdle ="0" maxWait ="100000" username ="admin" password ="" driverClassName ="sun.jdbc.odbc.JdbcOdbcDriver" url ="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=c:/jbproject/flive_demo/demo.mdb" /> </ GlobalNamingResources > 在项目的context文件中(一般在${tomcat_home}/conf/catalina/localhost/目录下面): < Context path ="..." reloadable ="..." docBase ="..." workDir ="..." > < ResourceLink name ="jdbc/FLIVE_DEMO" global ="jdbc/GLOBAL_DEMO" type ="javax.sql.DataSource" /> </ Context > 在项目的web.xml文件中: < resource-ref > < res-ref-name > jdbc/FLIVE_DEMO </ res-ref-name > < res-type > javax.sql.DataSource </ res-type > < res-auth > Container </ res-auth > </ resource-ref >