0
我正在jax-rs(jersey)
並希望通過使用休眠連接到數據庫。我的項目工作完全正常,當我調試它爲Java應用程序,但是當我在服務器上運行我的項目它給發現jdbc:mysql://localhost:3306/sample
沒有合適的驅動程序發現異常:休眠
here is my hibernate.cfg.xml file
的SQL異常沒有合適的驅動程序是在這裏
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/sample at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:208) at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:301) at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214)
有你包括[MySQL JDBC驅動程序(https://mvnrepository.com/artifact/mysql/mysql-connector-java/6.0.5)在你的類路徑? –