The BACKUP
SQL statement and the Backup
tool both create a zip file with the database file. However, the contents of this file are not human readable.
The resulting backup is transactionally consistent, meaning the consistency and atomicity rules apply.
BACKUP TO 'backup.zip' "
Any hints appreciated!
Thanks in advance, cause I am little stuck...
Peter
if (FilesOnUSB.file != null) {
//get Session from the unwrap method of our persistenceUnit 'entityManager'
Session session = entityManager.unwrap(Session.class);
// Begin of a sql query n the session
session.beginTransaction();
// create data consistent call of backup command of h2 and execute it directly
session.createSQLQuery("BACKUP TO \'/media/usb/erestau.zip\'").executeUpdate();
// finalize sql query, flush session
session.getTransaction().commit();
session = null;
}