Skip to content

Commit

Permalink
Always fallback to VARCHAR for null columns with NVARCHAR definition
Browse files Browse the repository at this point in the history
  • Loading branch information
tijsrademakers committed Jun 18, 2024
1 parent a405f08 commit 56bea27
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public void setParameter(PreparedStatement ps, int i, String parameter, JdbcType
}
try {
if (useDefaultJdbcType) {
ps.setNull(i, jdbcType.TYPE_CODE);
JdbcType finalJdbcType = null;
if (jdbcType.equals(JdbcType.NVARCHAR)) {
finalJdbcType = JdbcType.VARCHAR;
} else {
finalJdbcType = jdbcType;
}
ps.setNull(i, finalJdbcType.TYPE_CODE);

} else {
ps.setNull(i, Types.NULL);
}
Expand Down

0 comments on commit 56bea27

Please sign in to comment.