Update CommonRdbmsWriter.java

add PostgreSQL bit  type conversion
This commit is contained in:
wjxKOI 2025-04-09 11:51:09 +08:00 committed by GitHub
parent d82a5aeae6
commit 64543d7f04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -538,6 +538,13 @@ public class CommonRdbmsWriter {
case Types.BIT:
if (this.dataBaseType == DataBaseType.MySql) {
preparedStatement.setBoolean(columnIndex + 1, column.asBoolean());
} else if (this.dataBaseType == DataBaseType.PostgreSQL) {
Boolean booleanValue = column.asBoolean();
if (booleanValue) {
preparedStatement.setString(columnIndex + 1, "1");
} else {
preparedStatement.setString(columnIndex + 1, "0");
}
} else {
preparedStatement.setString(columnIndex + 1, column.asString());
}