初始配置如下:
启动tomcat报异常信息:
严重: Unable to create initial connections of pool.
java.sql.SQLException: com.mysql.jdbc.Driver at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254) at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635) at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486) at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144) at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116) at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)....
最后解决方式两种:
一:在tomcat/lib目录添加数据库连接jar包
二:tomcat目录不变,修改配置如下:
个人推荐第二种方法。
具体原因参考文章: