我在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.
我应该如何配置和使用呢?
罗布