setObject bug in postgresql jdbc driver

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: setObject bug in postgresql jdbc driver
Date: 2001-04-13 11:46:08
Message-ID: 00a601c0c40f$54e6a890$0401a8c0@INSPIRON
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hi,

I have some code which legitimately tries to call setObject(n,o) where o is an Object, and is null. The jdbc driver doesn't check for this type, and as a result fails.

This is how I changed the code to deal with this.

public void setObject(int parameterIndex, Object x) throws SQLException
{
if (x == null){
// postgres ignores the type so it doesn't matter what we pass
setNull(parameterIndex,Types.OTHER);
return;
}

Is there any reason why it wouldn't check for null right away ?

Can someone commit this to the source tree if it is ok?

Regards,

Dave Cramer

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2001-04-13 12:17:55 New look for the techdocs website...
Previous Message Peter Eisentraut 2001-04-13 11:19:54 Re: Address already in use?