当前位置: 代码迷 >> J2EE >> 亟需帮助!Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql:/
  详细解决方案

亟需帮助!Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql:/

热度:210   发布时间:2016-04-21 23:44:02.0
急需帮助!Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql:/
初学hibernate,在连接mysql时,测试类main方法中可以运行获得数据,tomcat就报错
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/test
求高手指点指点!!!


<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<property name="connection.driver-class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://127.0.0.1:3306/test</property>
<property name="connection.username">root</property>
<property name="connection.password">123123</property>

<property  name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="current_session_context_class">thread</property>

<mapping resource="ShoppingCart/shoppingcart.hbm.xml"></mapping>

</session-factory>
</hibernate-configuration>

------解决方案--------------------
貌似没添加mysql  jar包
  相关解决方案