title: what is META-INF/persistence.xml in netbeans?
body: <p>I am building a semester Java project that relies on DB, so I read tutorials about JDBC and I built simple app that reads from a MySQL DB. I tried Netbeans desktop database application to read the generated code, but I found that Netbeans takes a very different approach to connect to the database and I can't understand why it uses a <code>persistence.xml</code> file and what is the persistence package used for?</p>
  
  <pre><code>    Class.forName("com.mysql.jdbc.Driver");
      String connectionUrl = "jdbc:mysql://localhost/mysql?" +
                             "user=root&amp;password=123456";
      Connection con = DriverManager.getConnection(connectionUrl);
  </code></pre>
  
  <p>Can anyone guide me to tutorials to understand this approach ? And why Netbeans uses this code instead of the usual code I posted ?</p>