commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [DBUtil] setNull cause insert to fail.
Date Thu, 18 Dec 2003 22:28:16 GMT

--- Erez Nahir <enahir@cisco.com> wrote:
> Hi,
>  
> I have a code with sql having long, int, String and boolean values. Some
> of
> my Strings can be null. 
> When QueryRunner.fillStatement identify null value in the object[] it
> uses
> stmt.setNull(Types.OTHER); after the sql is filled with the params, the
> executeUpdate fails with excetion message:
>  
> Failed to insert base data JZ006: Caught IOException:
> java.io.IOException:
> JZ0SM: Unsupported SQL type 1111. Query: insert into BB_MAIN
>
(OBJECTID,ACTOBJECTID,NODEID,ACTIVITYID,CHANGE,TYPE,NAME,"COMMENT",CATEGORY,
> MANDATORY,"GROUP",REFS)values (?,?,?,?,?,?,?,?,?,?,?,?) Parameters: [0,
> 0,
> 0, 0, null, Network, NetName, Comment, red, false, true, null]
>  
> I'm using Sybase 8.0.2. 
>  
> Is this a known problem?, is there a solution?

Maybe this is a problem with the Sybase driver you're using.  You can
subclass QueryRunner and override the fillStatement method to do what you
need.

David

> Before I switched to DBUtil it worked fine with stmt.setString(null),
> but I
> had to write lot of code:-(.
>  
> Thanks,
> Erez.
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message