Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialization and Resultset

 
Kriti Garg
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My question is...
"why connection/resultset do not implement serializable interface".
like TimeStamp or Date do so

Thanks
Kriti
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 java.io 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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


Thanks,
Kriti
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic