hibernate数据库(MySql)连接文件,测试时用的是MySql数据库

文件名为:hibernate.cfg.xml

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools.-->
<hibernate-configuration>
  <session-factory>
    <property name="javax.persistence.validation.mode">none</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/dbTest</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password">123456</property>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="connection.useUnicode">true</property>
    <property name="connection.characterEncoding">UTF-8</property>
    <property name="hibernate.format_sql">true</property>
    <property name="hibernate.show_sql">true</property>
   
    <!-- 文件映射 -->
    <mapping resource="bean/Admin.cfg.xml" />
    <mapping resource="bean/Category.cfg.xml" />
  </session-factory>
</hibernate-configuration>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

您的十分满意是我追求的宗旨。

您的一点建议是我后续的动力。








本文转载:CSDN博客