首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

JpA persistence.xml资料

2012-10-14 
JpApersistence.xml文件?mysql 驱动包 版本 5.1.7??xml version1.0?persistence xmlnshttp://java

JpA persistence.xml文件

?

mysql 驱动包 版本 5.1.7

?

<?xml version="1.0"?>
<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_1_0.xsd"
??? version="1.0">
? <!-- 持久化单元,就是一些实体的集合??? 事务类型为本地事务 -->
? <persistence-unit name="itcast" transaction-type="RESOURCE_LOCAL">
?
? ?? <!-- JPA的驱动,就类似JDBC的驱动,是跟JPA实现对接的入口类 -->
? ?? <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="000000"/>
???????? <property name="hibernate.connection.url" value="jdbc:mysql://127.0.0.1:3306/itcast?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
???????? <property name="hibernate.hbm2ddl.auto" value="create"/>
???????? <property name="hibernate.show_sql" value="true"/>
???????? </properties>
? </persistence-unit>
?
</persistence>

?

?

oracl

?

<?xml version="1.0"?>
<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_1_0.xsd"
??? version="1.0">
?<!-- ??
? <persistence-unit name="chijiu" transaction-type="RESOURCE_LOCAL">
? ?? <provider>org.hibernate.ejb.HibernatePersistence</provider>
????????? <jta-data-source>jdbc/web</jta-data-source>
? ?? <properties>
???????? <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
???????? <property name="hibernate.hbm2ddl.auto" value="create"/>
???????? <property name="hibernate.show_sql" value="true"/>
????????? <property name="hibernate.query.factory_class"? value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
??? </properties>
? -->??
???
???
????
???
? <persistence-unit name="chijiu" transaction-type="RESOURCE_LOCAL">
? ?? <provider>org.hibernate.ejb.HibernatePersistence</provider>
? ?? <properties>
???????? <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
???????? <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
???????? <property name="hibernate.connection.username" value="webuser"/>
???????? <property name="hibernate.connection.password" value="webuser"/>
???????? <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.168.1.34:1521:edugate"/>
???????? <property name="hibernate.hbm2ddl.auto" value="update"/>
???????? <property name="hibernate.show_sql" value="false"/>
????????? <property name="hibernate.query.factory_class"?
????????? ?value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
</properties>

?

?


?
</persistence-unit>
</persistence>

热点排行