// This will throw an Error exception if the database system has already
// been initialized.
system.init(config);
// Note, currently we only register one database, and it is named
// 'DefaultDatabase'.
Database database = new Database(system, "DefaultDatabase");
boolean success = false;
try {
// Convert to the current version.
success = database.convertToCurrent(System.out, stringUser);
} catch (IOException e) {
System.out.println("IO Error: " + e.getMessage());
e.printStackTrace(System.out);
}
if (success) {
System.out.println("-- Convert Successful --");
} else {
if (stringDriver.compareTo(DataConnection.MCKOI_DRIVER) != 0 &&
stringUser.compareTo("PasswordIsPass") != 0) {
//they are using another database, try again.
try {
// Convert to the current version.
success = database.convertToCurrent(System.out, "PasswordIsPass");
} catch (IOException e) {
System.out.println("IO Error: " + e.getMessage());
e.printStackTrace(System.out);
}
}