bugfix DB Backup

This commit is contained in:
Stefan Hardegger
2025-07-31 07:30:23 +02:00
parent 590e2590d6
commit 9e788c2018
2 changed files with 9 additions and 8 deletions

View File

@@ -85,15 +85,16 @@ public class DatabaseManagementService {
Object value = rs.getObject(i);
if (value == null) {
sqlDump.append("NULL");
} else if (value instanceof String || value instanceof Timestamp ||
value instanceof java.util.UUID) {
} else if (value instanceof Boolean) {
sqlDump.append(((Boolean) value) ? "true" : "false");
} else if (value instanceof Number) {
// Handle numeric types (Integer, Long, Double, etc.)
sqlDump.append(value.toString());
} else {
// Handle all other types as strings (String, UUID, Timestamp, CLOB, TEXT, etc.)
// Escape single quotes and wrap in quotes
String escapedValue = value.toString().replace("'", "''");
sqlDump.append("'").append(escapedValue).append("'");
} else if (value instanceof Boolean) {
sqlDump.append(((Boolean) value) ? "true" : "false");
} else {
sqlDump.append(value.toString());
}
}

View File

@@ -16,8 +16,8 @@ spring:
servlet:
multipart:
max-file-size: 5MB
max-request-size: 10MB
max-file-size: 250MB
max-request-size: 250MB
server:
port: 8080