• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Storing Object of a class in Sybase

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any replies ???
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Patience is a virtue.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic