hibernate在tomcat下无法访问数据库
hibernate在eclipse下可以连接到数据库,一发布到tomcat就报错:
1.No suitable driver found for jdbc:mysql:///hibernate;
2.Error calling DriverManager#getConnection;
3.Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]。
测试过同一段代码在eclipse下用hibernate和dbutils都可以连接到数据库,但发布到tomcat只有dbutils才能访问到数据库。
我的用是apache-tomcat-7.0.52和驱动包mysql-connector-java-5.1.7-bin.jar。
昨天才刚学了hibernate,今天遇到这问题查了一天都没发现问题.
下面是hibernate和c3p0的配置文件