To backup HSQLDB catalog in manaual :
BACKUP DATABASE TO directory name BLOCKING [ AS FILES ]
when I apply in calableStatement :
try {
cs = conn.prepareCall("BACKUP DATABASE COMPRESSED TO './backup/' BLOCKING ");
cs.execute();
cs.close();
} catch (SQLException e) {
e.printStackTrace();
}
1- If I add COMPRESSED and execute I get SQL exception :
java.sql.SQLSyntaxErrorException: unexpected token: COMPRESSED required: TO in statement [BACKUP DATABASE COMPRESSED TO './backup/' BLOCKING ]
2- If I remove COMPRESSED ...the sql query complains that COMPRESSED should be added (attached)...Though zip backup folder gets created ..
NOTE: using jave 8 , HSQLDB 2.4 Server Remote ,IntelliJ IDEA ,database name is ProDB.
The syntax for this command allows the settings only at the end of the statement:
BACKUP DATABASE TO <file path> [SCRIPT] {[NOT] COMPRESSED} {[NOT] BLOCKING} [AS FILES]
It looks like the suggestion is generated only by IntelliJ.
Please note use of prepareCall is required only for calling procedures and functions. It is better to use prepareStatement for all other executions.