File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Common data type for XML in a database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Common data type for XML in a database" Watch "Common data type for XML in a database" New topic
Author

Common data type for XML in a database

David Garratt
Ranch Hand

Joined: Aug 08, 2003
Posts: 196

I would like to store XML in a database, however as my application currently runs under mysql, sql 2005 and oracle 10g I would like to use a column type in each database which is the same, at least from the perspective of jdbc.

Can anyone suggest anything, all the vendors seem to have different names for similar types and it's very confusing.

The data will not be indexed and is just for storage. I cannot guarantee that an xml will be limited to only small sizes.

Thanks

Dave
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
How about the CLOB (Character Large Object)type?
One important thing to keep in mind is to use the correct character encoding whatever data type you use.
David Garratt
Ranch Hand

Joined: Aug 08, 2003
Posts: 196

But some database vendors don't seem to call their CLOB by that name, so can you tell me what their respective terms are ?

Thanks

Dave
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

So, your question is "What does Oracle call a CLOB?"

That isn't much of an XML question. More of a JDBC question, I would say. Moving...
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30516
    
150

Dave,
mysql and Oracle both call it a CLOB.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
Originally posted by Jeanne Boyarsky:
Dave,
mysql and Oracle both call it a CLOB.


... and SQL Server, Sybase, DB2, etc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Common data type for XML in a database