Blobs??

11 views
Skip to first unread message

Jim Redman

unread,
May 15, 2012, 11:32:43 AM5/15/12
to sqld...@googlegroups.com
What has anyone done with blobs? This line:

setObj(parameterIndex, theBlob.getBytes(0, (int)theBlob.length()));

in SQLPreparedStatement seems incorrect because the first parameter
(position) must be 1 or greater. Is this just unused/untested or an I
doing something wrong?

Jim

--
Jim Redman
(505) 662 5156 x85
http://www.ergotech.com

Uwe Kubosch

unread,
May 15, 2012, 2:56:30 PM5/15/12
to <sqldroid@googlegroups.com>
I have not used blobs with SQLDroid, so I guess this is unused/untested.
--
Uwe Kubosch
Systems Developer
Datek Wireless AS
u...@datek.no
http://datek.no/


Damodar Periwal

unread,
May 15, 2012, 9:30:38 PM5/15/12
to sqld...@googlegroups.com
I have used a BLOB column and then used the setBinaryStream() method to initialize it successfully with some binary image data.  I have not explicitly used the setBlob() call though.  Nonetheless, I think that for all setXXX methods, the caller has to pass a parameterIndex value, which is 1 based (not 0 based).  See http://docs.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html#setBlob%28int,%20java.io.InputStream,%20long%29

-- Damodar
Reply all
Reply to author
Forward
0 new messages