title: Environment specific Persistence xml in java standalone application
body: <p>I have a standalone java application, which uses JPA for its persistence.
  Right now I have a persistence.xml in META-INF.My application is currently in development.
  My question is that if I move from development to the next envirnoment, say QA. I have to modify the persistence.xml and rebuild the jar. Is this the right way to go about it ?
  If not,if I move the connection properties to a different file, where should this file be placed? </p>
  
  <pre><code>&lt;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_2_0.xsd" version="2.0"&gt;
      &lt;persistence-unit name="pu1" transaction-type="RESOURCE_LOCAL"&gt;
          &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
          &lt;class&gt;ClassA&lt;/class&gt;
          &lt;class&gt;ClassB&lt;/class&gt;
          &lt;class&gt;ClassC&lt;/class&gt;
          &lt;class&gt;ClassD&lt;/class&gt;
  
  
          &lt;properties&gt;
              &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" /&gt;
              &lt;property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" /&gt;
              &lt;property name="hibernate.show_sql" value="true" /&gt;
              &lt;property name="hibernate.connection.username" value="username" /&gt;
              &lt;property name="hibernate.connection.password" value="password" /&gt;
              &lt;property name="hibernate.connection.url"
                  value="url" /&gt;
              &lt;property name="hibernate.max_fetch_depth" value="3" /&gt;
              &lt;property name="hibernate.archive.autodetection" value="class" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Thanks in advance !</p>