hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<!--SessionFactory配置-->
<session-factory>
<!-- 数据库URL -->
<property name="connection.url">jdbc:mysql://localhost/demo</property>
<!-- JDBC驱动程式 -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- 数据库用户名 -->
<property name="connection.username">caterpillar</property>
<!-- 数据库密码-->
<property name="connection.password">123456</property>
<!-- 是否将运行期的SQL输出到日志以供调试 -->
<property name="show_sql">true</property>
<!-- 将显示的SQL排版,方便观看 -->
<property name="format_sql">true</property>
<!-- 每个数据库都有其对应的Dialet以匹配其平台特性 -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- 是否使用数据库外连接-->
<property name="use._outer_join">true</property>
<!-- 映射文件配置,注意配置文件名必须包含其相对于根的全路径-->
<property name="com/redsaga/quickstart/Tuser.hbm.xml">123456</property>
</session-factory>
</hibernate-configuration>
hibernate配置
最新推荐文章于 2022-11-22 11:52:35 发布