Tomcat不修改配置文件,实现JDBC数据源的配置

直接在工程目录的META-INF下新建Context.xml 内容如下:

<?xml version="1.0" encoding="UTF-8"?>



<Context>

<Resource name="jdbc/bookstore" auth="Container" type="javax.sql.DataSource"

maxActive="100" maxIdle="30" maxWait="10000" username="classiccars"

password="classiccars" driverClassName="org.apache.derby.jdbc.ClientDriver"

url="jdbc:derby://localhost:1527/bookstore;create=true" />

</Context>

你可能感兴趣的:(tomcat)