Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can we store serialized object  RSS feed

 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • 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).]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • 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
  • 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: 6920
  • Mark post as helpful
  • send pies
  • 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
  • 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?

 
Amar, Nandigam
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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.

 
octavyn pittman
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • 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
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a sample code to use BLOB which got from JGuru JDBC faq
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!