一、Hibernate的配置
(1)首先我们要从网上下载到hibernate的包,在里面的lib包下面找到required包下面所有的jar文件 复制到我们项目下面的lib文件夹下。
(2)hibernate需要在src下面增加hibernate.cfg.xml,这个里面配置数据库的连接信息。此配置信息如下:<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- JDBC数据库连接信息 --> <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property> <property name="connection.url">jdbc:sqlserver://localhost:1433;DatabaseName=test</property> <property name="connection.username">test</property> <property name="connection.password">test</property> <!-- 数据库的方言 --> <property name="dialect"