tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Einfeldt" <ralph.einfe...@uptime-isc.de>
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,
Date)
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 [mailto:pkofon@hotmail.com]
> Gesendet: Mittwoch, 12. Juni 2002 19:39
> An: tomcat-user@jakarta.apache.org
> Betreff: Storing Java Objects in SQL
> 
> 
> I'm trying to store objects (instances) of a class in Microsoft SQL
Server 
> 2K using the Microsoft-provided JDBC driver, but I've been without any
luck 
> 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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message