JavaWeb_(Spring框架)Spring整合Hibernate
Dao层类要继承HibernateDaoSupport.java父类 原先使用Hibernate框架hibernate.cfg.xml配置数据库 <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql:///spring</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connecton.password">123456</property> <!-- 数据库的方言 --> <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property> <!-- 是否显示sql语句 --> <property name="hibernate.show_sql">true</property> <!-- 是否格式化sql语句 -->