0
Bold Text Here

**

java.io.ByteArrayOutputStream  fos = new java.io.ByteArrayOutputStream ();
java.io.ObjectOutputStream oos = new java.io.ObjectOutputStream(fos);
oos.writeObject(chmObjSessionKeyValue); //ConcurrentHashMap
oos.flush();
oos.close();
byte buff[]=fos.toByteArray();
ps.setString(2,strSessionId);
ps.setBytes(1,buff);
ps.execute();



//Read object

java.io.InputStream in=null;

        while(rs.next())
        {
            in=rs.getBinaryStream(2);
        }
    java.io.ObjectInputStream oos = new java.io.ObjectInputStream(in);
        java.util.concurrent.ConcurrentHashMap chmObjectSessionInfo=(java.util.concurrent.ConcurrentHashMap)oos.readObject();   
        CoreLogger.log("Concurrent hashmap object::"+chmObjectSessionInfo);
        oos.close();

Inline Code Example Here**

Bold Text Here

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by karthick2388
0
//The above code first block writes the object into blob as bytearray. I need to write and read as Shift-JIS
//Since the data stored in teh object has japanese.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.