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

//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.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.