今天在配置hibernate之后,进行添加数据测试时,运行中报出了 the user must supply a jdbc connection 这个错误 ,回头看了一下配置文件,原来是hibernate的属性配置写错了。
正确的hibernate属性配置应该时这样:
<session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/mybbs
</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="myeclipse.connection.profile">mysql</property>
<mapping resource="com/mybbs/pojo/Userinfo.hbm.xml" />
</session-factory>