引言:Hibernate主配置文件 为hibernate.cfg.xml
<?xml version=”1.0” encoding=”UTF-8”?>
<!DOCTYPE hibernate-configuration PUBLIC
“-//Hibernate/HibernateConfiguration DTD 3.0//EN”
“http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd”>
<session-factory>
<property name=”hibernate.connection.driver_class”>com.mysql.jdbc.Driver</property>
<property name=”hibernate.connection.url”>jdbc:mysql:///hibernate</property>
<property name=”hibernate.connection.username”>root</property>
<property name=”hibernate.connection.password”>0516</property>
<property name=”hibernate.dialect”>org.hibernate.dialect.MySQLDialect</property>
<property name=”hibernate.show_sql”>true</property> 显示SQL
<property name=”hibernate.format_sql”>true</property> 格式化SQL
<property name=”hibernate.hbm2ddl.auto”>update</property>