Hibernate day02(1)

<!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>
		<!-- 配置连接数据库的参数 -->
		<!-- 配置数据库的方言 -->
		<property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
		<!-- 数据库驱动 -->
		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
		<property name="hibernate.connection.url">jdbc:mysql:///test</property>
		<property name="hibernate.connection.username">root</property>
		<property name="hibernate.connection.password">root</property>
		 <property name="hibernate.show_sql">true</property>
		 <!-- 其它属性配置 -->
		<!-- 指明C3P0的提供者 -->
		<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
		<!-- 连接池参数的配置 -->
		<property name="hibernate.c3p0.min_size">5</property> 
	    <property name="hibernate.c3p0.max_size">30</property> 
	    <property name="hibernate.c3p0.timeout">1800</property> 
	    <property name="hibernate.c3p0.max_statements">50</property>
	    
	    <!-- 打印SQL语句到控制台 -->
		<property name="hibernate.show_sql">true</property>
		<property name="hibernate.format_sql">true</property>
		<property name="hibernate.hbm2ddl.auto">update</property> 
		<!-- 注册实体的对象关系映射文件 -->
		<mapping resource="model/Account.hbm.xml"/>
	</session-factory>
</hibernate-configuration>


你可能感兴趣的:(Hibernate day02(1))