1,hibernate.cfg.xml配置信息
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!DOCTYPE hibernate-configuration SYSTEM "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!--数据库方言-->
<property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </property>
<property name="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </property>
<!--连接数据库驱动-->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!--连接地址-->
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test </property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test </property>
<!--用户名-->
<property name="hibernate.connection.username"> root </property>
<property name="hibernate.connection.username"> root </property>
<!--密码-->
<property name="hibernate.connection.password"> ****** </property>
<property name="hibernate.connection.password"> ****** </property>
<!--连接池-->
<property name="connection.pool_size">2</property>
<!--POJO类与数据库表的映射文件-->
<mapping resource="#######.hbm.xml"/>
</session-factory>
</hibernate-configuration>
<mapping resource="#######.hbm.xml"/>
</session-factory>
</hibernate-configuration>