tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Einfeldt" <>
Subject AW: Storing Java Objects in SQL
Date Thu, 13 Jun 2002 06:06:19 GMT
The most driver I know, just support setObject for a given
set of classes (typically some or all Subclasses of Number, String,
or column types (typicaly no blobs)

To use a portable solution I would serialize the Object to an byte array
and store it with PreparedStatement.setBytes()

As storing blobs is a quite a pain if you deal with different databases.
(At least it was, 1 year ago) I prefer to store blobs outside of the 
database. (To do this, you have to make shure that you don't delete or 
overwrite the file before the transaction is committed)

> -----Urspr√ľngliche Nachricht-----
> Von: Paul Kofon []
> Gesendet: Mittwoch, 12. Juni 2002 19:39
> An:
> Betreff: Storing Java Objects in SQL
> I'm trying to store objects (instances) of a class in Microsoft SQL
> 2K using the Microsoft-provided JDBC driver, but I've been without any
> thus far.
> I've used the setObject() method in the PreparedStatement class and
set my 
> target sql type to "BINARY", yet it doesn't work, I keep getting an 
> SQLException. 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message