1. config文件的创建:

 

内容:


"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">


root
root
com.mysql.jdbc.Driver
jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8
org.hibernate.dialect.MySQLDialect
true
true
create
thread



 

2.mapping文件的创建: