JSON vs. XML vs. Blob

I would like to store some objects in the database in order to be able to restore them  for future use.
I am using Postgres 8.4 and I know that I can serialize those objects ans store them as BLOBs, but , I would like to have a readable format so I can easily debug it and see the stored object content.
1) Is there any option to store a Java object as JSON or XML ?
2) how is it compared to the BLOB  option from performance point of view ?

LVL 19
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Well XMl as JSSON are simple tex formats. So  you can write them anywhere and reconstruct whatever you likke from it. JSON. What you prefer is you choice. I'd prfer JSON anytime. XML is just too bloated for my taste. See e.g http://json.org/xml.html

And you wrote about storing objects we. than JSON seems to be better because it supposed to be used for that kind of work.

However Postgresql has extra support for XML. See  e.g http://www.postgresql.org/docs/current/static/datatype-xml.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.