读书人

ssj项目学习之persistence.xml配备

发布时间: 2012-12-21 12:03:49 作者: rapoo

ssj项目学习之persistence.xml配置

<?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="news" transaction-type="RESOURCE_LOCAL"><properties><property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/><property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/><property name="hibernate.connection.user" value=""/><property name="hibernate.connection.password" value=""/><property name="hibernate.connection.url" value="jdbc:sqlserver://202.109.251.111;databaseName="/><property name="hibernate.hbm2ddl.auto" value="update"/><property name="hibernate.show_sql" value="true"/><property name="hibernate.format_sql" value="false"/><property name="hibernate.max_fetch_depth" value="3"/></properties></persistence-unit></persistence>

JPA规范要求在类路径的META-INF目录下放置persistence.xml, 文件的名称是固定的,内容大体和hibernate差不多

读书人网 >XML SOAP

热点推荐