首页 > 数据库技术 > 详细

No suitable driver found for jdbc:mysql://localhost:3306/hibernate_basic

时间:2014-06-18 18:42:14      阅读:505      评论:0      收藏:0      [点我收藏+]

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>

就正常运行了

No suitable driver found for jdbc:mysql://localhost:3306/hibernate_basic,布布扣,bubuko.com

No suitable driver found for jdbc:mysql://localhost:3306/hibernate_basic

原文:http://www.cnblogs.com/friends-wf/p/3790818.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!