Linux - tomcat -jndi数据源配置
tomcat/conf/context .xml 文件中修改如下
1 <Resource
2 name="/jdbc/……"
3 auth="Container"
4 type="javax.sql.DataSource"
5 factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
6 jmxEnabled="true"
7 testWhileIdle="true"
8 testOnBorrow="true"
9 testOnReturn="false"
10 validationQuery="SELECT 1"
11 validationInterval="30000"
12 timeBetweenEvictionRunsMillis="30000"
13 maxActive="800"
14 minIdle="50"
15 maxIdle="100"
16 maxWait="10000"
17 minEvictableIdleTimeMillis="30000"
18 initialSize="10"
19 removeAbandonedTimeout="3600"
20 removeAbandoned="true"
21 logAbandoned="true"
2 jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
23 driverClassName="com.mysql.jdbc.Driver"
24 url="jdbc:mysql://……/……?allowMultiQueries=true"
25 username="……"
26 password="……"
27 />