On 30 November 2011 20:01, Oliver Jowett <oliver@opencloud.com> wrote:
> This is specific to calling PreparedStatement.setObject(index, null).
> To avoid this, use one of these instead:
>
> * PreparedStatement.setObject(index, null, type)
> * PreparedStatement.set<type>(index, null)
> * PreparedStatement.setNull(index, type)
>
> all of which provide type information that the driver needs.
I'd also refer you to the JDBC javadoc for setObject(int,Object) which says:
==
Note: Not all databases allow for a non-typed Null to be sent to the
backend. For maximum portability, the setNull or the setObject(int
parameterIndex, Object x, int sqlType) method should be used instead
of setObject(int parameterIndex, Object x).
==
Oliver