文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>各种数据库的persistence.xml

各种数据库的persistence.xml

时间:2011-06-14  来源:唐朝

SQLServer

<persistence-unit name="TestSSH1PU2" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.hadeslee.jpaentity.Department</class>
    <class>com.hadeslee.jpaentity.Person</class>
   <properties>
        <property name="hibernate.connection.driver_class" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
        <property name="hibernate.connection.url" value="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=testSSH"></property>
        <property name="hibernate.connection.username" value="sa"></property>
        <property name="hibernate.connection.password" value="hadeslee"></property>
        <property name="hibernate.show_sql" value="true"></property>
        <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"></property>
        <property name="hibernate.current_session_context_class" value="thread"></property>
    </properties>
  </persistence-unit>

MySQL

<persistence-unit name="myJpa" transaction-type="RESOURCE_LOCAL">
  <provider>org.hibernate.ejb.HibernatePersistence</provider>
  <properties>
   <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
   <property name="hibernate.connection.driver_class" value="org.gjt.mm.mysql.Driver" />
   <property name="hibernate.connection.username" value="root" />
   <property name="hibernate.connection.password" value="88010081" />
   <property name="hibernate.connection.url"
    value="jdbc:mysql://localhost:3306/jiayuerp?useUnicode=true&amp;characterEncoding=UTF-8" />
   <property name="hibernate.max_fetch_depth" value="3" />
   <property name="hibernate.hbm2ddl.auto" value="update" />
   <property name="hibernate.jdbc.fetch_size" value="18" />
   <property name="hibernate.jdbc.batch_size" value="10" />
   <property name="hibernate.show_sql" value="true" />
   <property name="hibernate.format_sql" value="true" />
  </properties>
 </persistence-unit>

 

Oracle

<persistence-unit name="default" transaction-type="RESOURCE_LOCAL">
    <provider>
        oracle.toplink.essentials.PersistenceProvider
    </provider>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
        <property name="toplink.logging.level" value="INFO"/>
        <property name="toplink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
        <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@myhost:l521:MYSID"/>
        <property name="toplink.jdbc.password" value="tiger"/>
        <property name="toplink.jdbc.user" value="scott"/>
    </properties>
</persistence-unit>

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载