![](https://i-blog.csdnimg.cn/blog_migrate/527ac9efafa5e404d413d3b0eb2224ab.png)
配置模板
![](https://i-blog.csdnimg.cn/blog_migrate/6688e852b91e0ca639ea681f980edbac.png)
<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="sample">
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
![](https://i-blog.csdnimg.cn/blog_migrate/9e8a7835cb0b7327aee758efc38d50ea.png)
<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">//本地事务和全局务
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.connection.username" value="HOTEL"/>
<property name="hibernate.connection.password" value="HOTEL"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@127.0.0.1:1521:ORCL"/>
</properties>
</persistence-unit>
</persistence>
最终配置信息