首页 » 技术分享 » persistence

persistence

 

<!--把meta-inf文件放在src根目录 -->

<persistence xmlns="http://java.sun.com/xml/ns/persistence"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence

    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"

    version="2.0">

<persistence-unit name="mysql">

    <properties>

        <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>

        <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/hibernate1??useUnicode=true&characterEncoding=UTF-8"/>

        <property name="hibernate.connection.username" value="root"/>

        <property name="hibernate.connection.password" value=""/>

        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

        

        <property name="hibernate.show_sql" value="true"/>

        <property name="hibernate.format_sql" value="true"/>

        <property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider"/>

        

        <property name="hibernate.current_session_context_class" value="thread"/>

        <property name="hibernate.hbm2ddl.auto" value="update"/>

    </properties>

</persistence-unit>

<persistence-unit name="oracle"></persistence-unit>

</persistence>

转载自原文链接, 如需删除请联系管理员。

原文链接:persistence,转载请注明来源!

0