- <!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>
- <!-- 在控制台显示SQL语句 -->
- <property name="show_sql">true</property>
- <!-- 连接数据库的方言 -->
- <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
- <!-- 连接数据库的驱动名 -->
- <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
- <!-- 连接数据库的URL -->
- <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/lab2</property>
- <!-- 连接数据库的用户名 -->
- <property name="hibernate.connection.username">root</property>
- <!-- 连接数据库的密码 -->
- <property name="hibernate.connection.password">529641314</property>
- <!-- 生成数据库表(生成后应注释此行) -->
- <!-- <property name="hibernate.hbm2ddl.auto">create</property> -->
- <!-- 保证每个线程有一个属于自己的Session对象 -->
- <property name = "hibernate.current_session_context_class">thread</property>
- <mapping resource="com/Entity/User.hbm.xml"/>
- </session-factory>
- </hibernate-configuration>
04-23
223
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交