1.在eclipse中新建一个Java web项目
2.输入项目名称,点击完成
3.在lib文件中导入jar包
4.在项目的src目录下,新建一个空白文件,命名为hibernate.properties
hibernate.properties代码如下:
hibernate.dialect = org.hibernate.dialect.MySQLDialect hibernate.connection.driver_class = com.mysql.jdbc.Driver hibernate.connection.url = jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8 hibernate.connection.username = root hibernate.connection.password = 123456 hibernate.show_sql = true