码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-06-18 18:41:57      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:class   java   com   strong   数据   os   

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

标签:class   java   com   strong   数据   os   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!