Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Created July 5, 2016 13:43
Show Gist options
  • Save cosbor11/57f2e133790b9343945c3ac127f645ea to your computer and use it in GitHub Desktop.
Save cosbor11/57f2e133790b9343945c3ac127f645ea to your computer and use it in GitHub Desktop.
Reconnect to the updated database.
// Create a database and its connection
PersistenceManagerFactory factory = new EmbeddedPersistenceManagerFactory(); //1
factory.setCredentials("onyx", "SavingDataisFun!"); //2
String pathToOnyxDB = System.getProperty("user.home")
+ File.separatorChar + ".onyxdb"
+ File.separatorChar + "sandbox"
+ File.separatorChar +"model-update-db.oxd";
factory.setDatabaseLocation(pathToOnyxDB); //3
factory.initialize();
PersistenceManager manager = factory.getPersistenceManager(); //5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment