File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Uploading xml to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Uploading xml to database" Watch "Uploading xml to database" New topic

Uploading xml to database

Smita Talawadekar

Joined: Jan 21, 2008
Posts: 9
Hello all,

Can we upload xml to database using jdbc? if so, how do we do that? can anyone explain by giving sample code or example.

thanks in advance...
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Hi Smita,

Can you tell us how you want to store the xml in the database, and what you want to do with that data later?
Please show us what you have already tried.

Regards, Jan

OCUP UML fundamental and ITIL foundation
Peter Johnson

Joined: May 14, 2008
Posts: 5852

How large is the XML data? What is the maximum size of a string that can be stored in your database? If the latter is greater than the former, you can store the XML in a string column. Otherwise use a CLOB.

JBoss In Action
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

Not directly without some form of transformation. It's a bit like apples and oranges when comparing XML and database data. You need an application to map one to the other else you may have a lot of denormalized data.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: Uploading xml to database
jQuery in Action, 3rd edition