Good night friends, I have a doubt that I can not solve it.

I have a JAVAFX, H2 and Liquibase application, I need to restore my backup 
without deleting all my objects.

1-  I can already do my backup
2 - I can already restore it, but only before deleting all my base.
3-  How can I restore the backup using for example the update of all tables or 
merge.

I will put as my implementations and thank you very much who can help.


public class H2DatabaseBackup implements DatabaseBackup {

@Override // Backup WORKS 100%
public void backupDatabase (Connection conn, String file) throws SQLException {
PreparedStatement statement = conn.prepareStatement ("SCRIPT TO?");
statement.setString (1, file);
statement.execute ();
}

@Override // HOW TO IMPORT
public void importDatabase (Connection conn, String file1) throws SQLException {
PreparedStatement statement = conn.prepareStatement ("RUNSCRIPT FROM?"); // 
NEED HELP
statement.setString (1, file1);
statement.execute ();


}

@Override // WORKS 100%
public void resetDatabase (Connection conn, String file2) throws SQLException {
PreparedStatement preparedStatement = conn.prepareStatement ("DROP ALL 
OBJECTS;");
preparedStatement.executeUpdate ();
PreparedStatement statement = conn.prepareStatement ("RUNSCRIPT FROM?");
statement.setString (1, file2);
statement.execute ();
}
}

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/6e6e49df-6355-437d-bf50-b5b75b9026fc%40googlegroups.com.

Reply via email to