Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing Object of a class in Sybase

 
Dush Vish
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to store an Object of a class in sybase, how can I do that and how can I retieve that too.
The issue over here is, I am getting messages really fast, the messages are nothing but Objects of some class, I dont have opportunity to process them and then acknowledge them. To acknowledge them I need to persist them in database as soon as they arrive, once acknowledged I will retrieve them and process them. Cant help its the requirement.
What is the best way to do this if I am using Java and Sybase?
Thanks!!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dush,
Welcome to JavaRanch!

When you say you are getting Objects, I assume you mean Java objects? If so, you can serialize them and store the serialized form as a BLOB type in the database.
 
Dush Vish
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,

Thanks for replying.
You are right to assume that its a java object.
How do you serialize the object?, I know you can serialize the class by implementing Serializable interface.

Secondly, there is a huge overhead in storing blob in sybase. It dosent directly supports BLOB.

In retrieving and stroring there is overhead. I was looking for something better.

To restate clearly, I am receiving message in the form of Java Object. I need to store them with minimum overhead for efficiency.

Thanks again.
DD
 
Dush Vish
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any replies ???
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem with your requirements is that the tools given to you don't satisfy them. If you have to store these java objects in a database and sybase is your only option and it doesn't support BLOB types, what else is there to tell you? You either don't use sybase or you lose efficiency. Take your pick.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dush Vish:
I know you can serialize the class by implementing Serializable interface.

That is precisely how you serialize a class.

Originally posted by Dush Vish:
In retrieving and stroring there is overhead. I was looking for something better.

To restate clearly, I am receiving message in the form of Java Object. I need to store them with minimum overhead for efficiency.

You could store the objects in a file if the database is too time consuming. You still need to Serialize them though.

Note that it is good to allow up to 24 hours for a response. Especially if that includes the overnight US time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic