setObject bug in postgresql jdbc driver - Mailing list pgsql-general

From Dave Cramer
Subject setObject bug in postgresql jdbc driver
Date
Msg-id 00a601c0c40f$54e6a890$0401a8c0@INSPIRON
Whole thread Raw
List 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
 

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Address already in use?
Next
From: Justin Clift
Date:
Subject: New look for the techdocs website...