Re: Patch to Village (Oracle Clobs)

Lionel Pasquier <[email protected]> Mon, 29 Mar 2004 11:54:42 +0200
Newsgroups gmane.comp.db.village.devel
Message-ID <[email protected]>
May I ask a question:
What if value is null (eg, we want to insert null in the DB for a BINARY ) ?

I am using torque which is using village, and trying to insert null for 
a Binary field, and got back :
java.lang.NegativeArraySizeException
	at 
org.postgresql.jdbc1.AbstractJdbc1Statement.setBinaryStream(AbstractJdbc1Statement.java:1257)


>   @@ -264,7 +269,11 @@
>                case Types.VARBINARY:
>                case Types.BINARY:
>                case Types.BLOB:
>   -                stmt.setBytes (stmtNumber, this.asBytes());
>   +                // The following form is reported to work and be necessary for
>   +                // Oracle when the blob exceeds 4k.
>   +                byte[] value = this.asBytes();
>   +                stmt.setBinaryStream(stmtNumber, 
>   +                        new java.io.ByteArrayInputStream(value), value.length);
>                    break;