MyEclipse6Java开发中文教程 persistence. xml name="PU1" name="PU2 provider class class class property propert 图132 persistence. xm的结构图 我们列出一份示例的代码清单,如下所示 <?xm/ version="1.0"encoding=UTF-8?> xminsxsi="http://ww.w3.org/2001/xmlschema-instance Xsi.schemalocation="http./java.sun.com/xmi/ns/persistence httpava.sun.com/xm/ns/persistence/persistence10.xsd"version=1.0> spersistence-unit name= JPADemoPU ction-type=RESOURCE LOCAL oracle toplink essentials. PersistenceProvider <classsjpadao Myuser</class> <property name=toplink jdbc driver" value="com mysql jdbc Driver"p property name="toplink jdbc. url value=jdbc. mysq / /localhost: 3306/test?useUnicode=true&, characterEncoding= GBK" <property name="toplink jdbc. user"value=root"p </persistence-unit> /persistence> 这个文件的内容包括一个或者多个持久化单元( persistence unit)的定义,这是和 刘长炯著MyEclipse 6 Java 开发中文教程 5 刘长炯著 图 13.2 persistence.xml 的结构图 我们列出一份示例的代码清单,如下所示: <?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="JPADemoPU" transaction-type="RESOURCE_LOCAL"> <provider> oracle.toplink.essentials.PersistenceProvider </provider> <class>jpadao.Myuser</class> <properties> <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver" /> <property name="toplink.jdbc.url" value="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding= GBK" /> <property name="toplink.jdbc.user" value="root" /> </properties> </persistence-unit> </persistence> 。 这个文件的内容包括一个或者多个持久化单元(persistence unit)的定义,这是和