Re: setUseServerPrepare & typecasts - Mailing list pgsql-jdbc

From Scott Lamb
Subject Re: setUseServerPrepare & typecasts
Date
Msg-id 3DD2FA61.2070502@slamb.org
Whole thread Raw
In response to Re: setUseServerPrepare & typecasts  (Aaron Mulder <ammulder@alumni.princeton.edu>)
Responses Re: setUseServerPrepare & typecasts  (Aaron Mulder <ammulder@alumni.princeton.edu>)
List pgsql-jdbc
Scott Lamb wrote:
> Aaron Mulder wrote:
>>     But I don't think you're supposed to use setObject for a null
>> value.  Instead, try
>>
>> setNull(1, Types.INTEGER)
>
> Hmm. Yeah, I guess the API docs don't really describe what setObject is
> supposed to do on null. But setNull(1, Types.INTEGER) seems to have the
> same problem.

Ahh, but the JDBC 3.0 specification does. Section 13.2.2.3 says "if a
Java null is passed to any of the setter methods that take a Java
object, the parameter will be set to JDBC NULL". So it should work.

Thanks,
Scott


pgsql-jdbc by date:

Previous
From: Scott Lamb
Date:
Subject: Re: setUseServerPrepare & typecasts
Next
From: Aaron Mulder
Date:
Subject: Re: setUseServerPrepare & typecasts