Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialize an object to db2

Negin Negin
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to serialize an object into the db2. The column name on my table for the object is type blob.
I do the followings to write to the db:
ByteArrayOutputStream output = new ByteArrayOutputStream();
ObjectOutputStream OutputStream = new
//pc is my object
byte[] pcByte = output.toByteArray();
I then pass pc Byte to my stored procedure where the datatype of the parameter to pass pc through is blob.

I am having difficulties reading the object back and casting it to its type.

could you help.

Many thanks in advance.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic