Re: Bug: Cannot pass null in Parameter in Query for ISNULL
От | Oliver Jowett |
---|---|
Тема | Re: Bug: Cannot pass null in Parameter in Query for ISNULL |
Дата | |
Msg-id | CA+0W9LM4xcS0r=X_TwUA4kJKpat+1WitY01eB8WD6Rgzj=i0mg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Bug: Cannot pass null in Parameter in Query for ISNULL (Oliver Jowett <oliver@opencloud.com>) |
Ответы |
Re: Bug: Cannot pass null in Parameter in Query for ISNULL
|
Список | pgsql-jdbc |
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
В списке pgsql-jdbc по дате отправления: