mysql版的配置文件:
<?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>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/test</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.pool_size">2</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<mapping resource="cn/xdy/h4/hello/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
本文介绍了一个针对MySQL数据库的Hibernate配置文件实例。配置中详细指定了连接驱动、URL、用户名、密码等属性,并设置了连接池大小及方言为MySQL方言,启用了SQL显示功能。
201

被折叠的 条评论
为什么被折叠?



