• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a note on chapter 6's applicationManagedSE

 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a friendly reminder, if you are using MySQL database, you need to include mysql-connector-java-xxx-bin.jar
where xxx is the latest version, in the build path.

My persistence.xml is:

<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="EmployeeService" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
  <class>examples.model.Employee</class>
        <validation-mode>NONE</validation-mode>
        <properties>
           <property name ="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/applicationManagedSE"/>
        <property name="javax.persistence.jdbc.user" value="user" />
        <property name="javax.persistence.jdbc.password" value="password"/>
    </properties>
  </persistence-unit>
</persistence>



You don't need jta-data-source node.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic