Well, as it turns out the answer to my question was much easier than I could have ever imagined. I was wondering why no one else seemed to have this problem. So, all I had to do was pass the 8 character studyId to the class that creates the EntityManagerFactory. I used the Persistence.createEntityManagerFactory(String persistenceUnit, Map<String, String> properties) to provide the "hibernate.connection.url" property a value of "jdbc:derby://localhost/database/EditorDatabase/"+studyId+";create=true"; Where the studyId represents the 8 character Id that the user selects when deciding which database to edit. It works like a charm.
|