File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Serialization and Resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Serialization and Resultset" Watch "Serialization and Resultset" New topic

Serialization and Resultset

Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
My question is...
"why connection/resultset do not implement serializable interface".
like TimeStamp or Date do so

Raj Chila
Ranch Hand

Joined: Mar 18, 2004
Posts: 128

Hi Kriti,

a Connections and Resultsets are very valuable and limited resources that help to connect to another system (RDBMS). you could probably write some logic to serialize the Objects, but the underlying resuources that these Objects depend on for connecting and reading data from a database will not be serialized..and will be reused when another process calls for their services.

just imagine a the management of files through package, here the file is the RDBMS.

I would be interested to know why you would want to Serialize a Connection and the Resultset Object...well it is a difference question if you want to serialize a connection related info or the Data that a Resultset represents.
Kriti Garg
Ranch Hand

Joined: Sep 13, 2004
Posts: 50
Hi RajaniKanth,

Thanks for your guidence ,actually i was studying about transient variables.

in Java2 the serializability concept was introduced and then they changed
most of there classes to implement Serializable interface.

but left classes like Graphics in java.awt and ResultSet,Connection in java.sql

Doubt about Graphics class is still not clear

I agree. Here's the link:
subject: Serialization and Resultset
It's not a secret anymore!