Hi,
I would like to save a serializable object into a mysql DB.
I was thinking to use a BLOB type

Here is my reading and writing code, but the reading doesnt work:
invalid stream header

------------------------------------------------------------------------
Ecriture:
------------------------------------------------------------------------
l.Entry = (DefaultStyledDocument) o;

try{
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream oout = new ObjectOutputStream(bout);
oout.writeObject(l.Entry);
oout.flush();
oout.close();
request = "UPDATE `logentry` SET `LogEntry` = '"+ oout + "' WHERE `Id` = '"+ l.Id +"'";
}catch (Exception ex){
System.out.println("error converting LogEntry:"+ ex.getMessage());
}

-------------------------------------------------------------
Lecture
-----------------------------------------------------------------
//ObjectInputStream ois = new ObjectInputStream(rsInit.getBlob("LogEntry").getBi naryStream());
ObjectInputStream ois = new ObjectInputStream(rsInit.getBinaryStream("LogEntry "));
try {
logEntry = (DefaultStyledDocument)ois.readObject();
}
catch (InvalidObjectException e) {
System.err.println(e);
}
ois.close();
-------------------------------------------------------------------

LogEntry is a Blob field in the DB

an exception is catch during the reading at this moment:
ObjectInputStream ois = new ObjectInputStream(rsInit.getBinaryStream("LogEntry "));

Error: invalid stream header