这是配置文件
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/building</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="connection.autocommit">true</property>
<property name="c3p0.min_size">5</property> <!--在连接池中可用数据库连接的最小数目-->
<property name="c3p0.max_size">30</property> <!--在连接池中所有数据库连接的最大数目-->
<property name="c3p0.timeout">1800</property> <!--设定数据库连接的超时时间-->
<property name="c3p0.max_statement">50</property> <!--可以被缓存的PreparedStatement的最大数目-->
<mapping resource="com/hibernate/entity/User.hbm.xml"/>
<mapping resource="com/hibernate/entity/Salesdepartments.hbm.xml"/>
<mapping resource="com/hibernate/entity/Premises.hbm.xml"/>
<mapping resource="com/hibernate/entity/Employees.hbm.xml"/>
<mapping resource="com/hibernate/entity/Donecustomer.hbm.xml"/>
<mapping resource="com/hibernate/entity/Customer.hbm.xml"/>
<mapping resource="com/hibernate/entity/Trading.hbm.xml"/>
</session-factory>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/building</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="connection.autocommit">true</property>
<property name="c3p0.min_size">5</property> <!--在连接池中可用数据库连接的最小数目-->
<property name="c3p0.max_size">30</property> <!--在连接池中所有数据库连接的最大数目-->
<property name="c3p0.timeout">1800</property> <!--设定数据库连接的超时时间-->
<property name="c3p0.max_statement">50</property> <!--可以被缓存的PreparedStatement的最大数目-->
<mapping resource="com/hibernate/entity/User.hbm.xml"/>
<mapping resource="com/hibernate/entity/Salesdepartments.hbm.xml"/>
<mapping resource="com/hibernate/entity/Premises.hbm.xml"/>
<mapping resource="com/hibernate/entity/Employees.hbm.xml"/>
<mapping resource="com/hibernate/entity/Donecustomer.hbm.xml"/>
<mapping resource="com/hibernate/entity/Customer.hbm.xml"/>
<mapping resource="com/hibernate/entity/Trading.hbm.xml"/>
</session-factory>









