The java.io.StreamCorruptedException is caused by trying to read data that was not written with an ObjectOutputStream. ObjectInputStream isn't some magical thing that turns ordinary data into
Java objects. You have to write an object to read an object. Have a look at
The Java Tutorial on Serialization for more. As for your other question, let's move this topic to the
JDBC forum.