persistent.xml
??
转载自http://tomfish88.iteye.com/blog/815798persistent.xml
XML
Hibernate
MySQL
JDBC
SUN
<?xml version="1.0" encoding="UTF-8"?> <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="jpaPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test"></property> <property name="hibernate.connection.username" value="root"></property> <property name="hibernate.connection.password" value="root"></property> <property name="hibernate.show_sql" value="true"></property> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"></property> <property name="hibernate.current_session_context_class" value="thread"></property> </properties> </persistence-unit>
<!-- <persistence-unit name="jpaPU" transaction-type="JTA"> <jta-data-source>jndi_mysql</jta-data-source> </persistence-unit> --> </persistence>
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |