Java PreparedStatement provides a possibility to explicitely set a Null value. This possibility is:
prepStmt.setNull(parameterIndex, Types.VARCHAR);
<
preparedStatement.setNull(index, java.sql.Types.NULL);
that should work for any type. Though in some cases failure happens on the server-side, like: for SQL:
COALESCE(?, CURRENT_TIMESTAMP)
Oracle 18XE fails with the wrong type: expected DATE, got STRING -- that is a perfectly valid failure;
Bottom line: it is good to know the type if you call .setNull()