Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes Uploading xml to database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Uploading xml to database" Watch "Uploading xml to database" New topic
Author

Uploading xml to database

Smita Talawadekar
Greenhorn

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
Bartender

Joined: Dec 20, 2006
Posts: 2477
    
    7

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
youtube channel
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

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: 3697
    
    5

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.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading xml to database
 
Similar Threads
can we access xml data returned by database in JPA
Splitting of XML
Java and XML
Can we say xml is a client database ?
Assignment Log Project