Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread kab
Hi, I tried to directly insert a Java object from typ mottrow.MItem to the table ITEMS in my embedded Derby DB. But I got the following error: java.sql.SQLException: An attempt was made to get a data value of type 'BLOB' from a data value of type 'mottrow.MItem' In the query I used, I had

Re: Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread Kristian Waagan
kab wrote: Hi, I tried to directly insert a Java object from typ mottrow.MItem to the table ITEMS in my embedded Derby DB. But I got the following error: java.sql.SQLException: An attempt was made to get a data value of type 'BLOB' from a data value of type ' mottrow.MItem' In the query I

Re: Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread Kevin Bortis
On 5/4/07, Kristian Waagan [EMAIL PROTECTED] wrote: I'm sure someone will give you the full story, but I believe you might have to serialize your objects yourself before you store them into the database as BLOB/VARCHAR FOR BIT DATA (depending on the maximum size of your objects, or your own

Re: Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread Kristian Waagan
Kevin Bortis wrote: On 5/4/07, *Kristian Waagan* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm sure someone will give you the full story, but I believe you might have to serialize your objects yourself before you store them into the database as BLOB/VARCHAR FOR BIT DATA

Re: Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread Bernt M. Johnsen
You need to serialize the object. One way of doing it is like this: ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(item); oos.close(); ps.setBytes(1, bos.toByteArray()); An

Re: Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread Rick Hillegas
Hi Kevin, I think that Kristian and Bernt have given you the workarounds for this issue. It is true that Java ADTs were supported in earlier versions of Cloudscape. However, those ADTs were declared in a non-standard way. ADT support was disabled before the code was open-sourced as