title: Configuring data source - tomee.xml, persistence.xml
body: <p>I'm doing some EJB with JPA project that maps/persists some entities to mysql database.
  I have defined persistence unit in persistence.xml like this:</p>
  
  <pre><code>  &lt;persistence-unit name="MyAppPU" transaction-type="JTA"&gt;
      &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
      &lt;jta-data-source&gt;MyAppDS&lt;/jta-data-source&gt;
      &lt;properties&gt;
        &lt;property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)" /&gt;
        &lt;property name="openjpa.jdbc.DBDictionary" value="mysql" /&gt;
        &lt;property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO" /&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>Then, in tomee/conf/tomee.xml file i have defined data source like this:</p>
  
  <pre><code>&lt;Resource id="MyAppDS" type="DataSource"&gt;
      JdbcDriver          com.mysql.jdbc.Driver
      JdbcUrl             jdbc:mysql://127.0.0.1:3306/MyAppDB
      UserName            root
      Password            123
      JtaManaged          true
      DefaultAutoCommit   false
  &lt;/Resource&gt;
  </code></pre>
  
  <p>All this works fine, i create MyApp.jar, deploy it to TomEE server, test it and i get mysql tables in database.
  My question is "Is there any other place where I could define data source resource?" 
  Or it has to be in tomee/conf/tomee.xml file?
  Can it be defined somewhere inside application structure, in some xml file, and deployed inside apps jar file to server?</p>