使用tomcat jdbc连接池时如何在tomcat上设置安全域?

时间:2015-07-06 17:12:24

标签: java jdbc tomcat8

我在tomcat 8中使用tomcat jdbc连接池:

PoolProperties p = new PoolProperties();
...
org.apache.tomcat.jdbc.pool.DataSource( p );

但我也在使用security Realm登录server.xml:

<Realm className="org.apache.catalina.realm.DataSourceRealm"
...
or <Realm  className="org.apache.catalina.realm.JDBCRealm" 
...

但它说:

SEVERE: Unable to create initial connections of pool.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

我应该如何配置和使用呢?

罗布

0 个答案:

没有答案