添加Hibernate环境
jar包:10 个 核心包,必须包,jpa,c3p0,jdbc
主配置文件hibernate.cfg.xml
映射文件 *.hbm.xml
一、主配置文件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>
<!-- 1.数据库连接信息 -->
<property name="dialet">org.hibernate.dialet.MySQL5InnoDBDialet</property>
<property name="connection.url">jdbc:mysql://itcastoa0720</property>
<property name="connection.dirver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<!-- 2.其他配置 -->
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<!-- 3.导入映射文件 <mapping resource="cn/User.hbm.xml" />-->
</session-factory>
</hibernate-configuration>