Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 24th, 2001, 11:32 PM
azaitchik azaitchik is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 6 azaitchik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Serializing Java Beans to database

I have a few very simple java beans I would like to save as a record in a database. (No problem for me to use jdbc to linearize or delinearize the objects.) My question: I thought I would have my bean implement Serializable or Externalizable and overwrite the readObject and writeObject methods to do database access.
What do I do about the ObjectOutputStream and ObjectInputStream objects these mthods must have as parameters? How can I connect a database connection and a stream of this sort? Seems like I would have to buffer linear data in a byte array buffer just to satisfy the signatures of these methods! This seems crazy and so I assume I am missing something obvious.
Is there any reason to use Serializable or Externalizable in this case? The Javasoft tutorial says a bean must implement these interfaces but surely that's not right, is it?
Help! Send a good code example, please!
Thanks,
Alan

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Serializing Java Beans to database

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap