初学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>
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>
在tomcat中找过跟多次有mysql的jar包,而且我测试类能成功运行,myeclipse部署后jar包会自动加到tomcat中啊,为什么还是没有匹配的驱动