• 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

How can we store serialized object

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to store an XML file as a serialized object somewhere so that i can later retrieve it through deserialisation when my application requires it.Is there any crack of doing it
I am asking it because as far as my knowledge goes
we cannot store serialzed objects in the database

[This message has been edited by Gaurav Chikara (edited March 19, 2001).]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A serialized object is just data, so it can be stored in a BLOB (Binary Large OBject) in a database.
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per said by Frank

Originally posted by Frank Carver:
A serialized object is just data, so it can be stored in a BLOB (Binary Large OBject) in a database.


Can anyone pls tell me hich databases have BLOB as one of the datatypes as I donot know about it
is it that way once object is serialized then it can be directly stored into BLOB datatype

 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Almost all modern SQL databases support BLOBs. BLOBs are directly supported in JDBC. Do you have any databases you are particularly thinking of using?
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thnkx for the Quick reply
as far as i know SQL server 7.0 donot have BLOB datatype
but I think Oracle 8.0 must be having it???
other doubt is do we have to convert our object into BLOB
or simply use the statement
insert into table(col1,col2) values (val1,val2)
(where val1 is my object) will it serve the purpose?

Originally posted by Frank Carver:
Almost all modern SQL databases support BLOBs. BLOBs are directly supported in JDBC. Do you have any databases you are particularly thinking of using?


 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gaurav,
there is a way you can convert your XML object into string and vice versa. Which parser are you using for your xml? DOM parser has a way to do this.
amar.
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Amar
i used SAX Parser and I still was able to convert xml document Into String without using SAX API
Any way thnkx for replying but here the problem is different
not how to convert xml into a String

Originally posted by Amar, Nandigam:
Hi Gaurav,
there is a way you can convert your XML object into string and vice versa. Which parser are you using for your xml? DOM parser has a way to do this.
amar.


 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oracle definitely supports BLOBs as does Informix. SQL Server 7 supports the Text data type as up to 2 GB of variable length data, as well as the VarBinary and Binary data types for binary data from 1-8000 bytes. (There is also the Image data type that can also contain up to 2 GB of variable-length binary data)
OP
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a sample code to use BLOB which got from JGuru JDBC faq
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic