views:

214

answers:

0

I am using the NetBeans IDE along with Java. I do want to distribute a database password/login in persistence.xml, but allow it to be set by the user/installing person in a config. The NetBeans IDE created a persistence.xml file for my connection that contains all of the database connection information and auto generates the code below:

org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(testapplication.TestApp.class).getContext().getResourceMap(ScrumManPasView.class);
entityManager = java.beans.Beans.isDesignTime() ? null :javax.persistence.Persistence.createEntityManagerFactory(resourceMap.getString("entityManager.persistenceUnit")).createEntityManager();

The docs say that you can override properties in the createEntityManagerFactory() with a map object, but how do I get it in the auto-generated code? What is the standard way to specify login credentials outside of persistence.xml with the NetBeans dataBase Application project type?