Struts Problem Report

Struts has detected an unhandled exception:

Messages:
  1. No suitable driver found for jdbc:mysql://localhost:3306/hibernate_basic
  2. Cannot open connection
  3. Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open connection
File: java/sql/DriverManager.java
Line number: 604

 

调试了半天,在@test程序中都能连接数据库正确

后来在 hibernate.cfg.xml中加入

<property name="connection.driver_class">com.mysql.jdbc.Driver</property>

就正常运行了

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-27
  • 2022-12-23
  • 2021-07-04
  • 2021-11-24
  • 2021-07-13
  • 2022-12-23
  • 2021-10-17
相关资源
相似解决方案