aspose 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


Win a copy of Spring in Action this week in the Spring forum!
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: 198

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: 350
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: 198

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: 18662
    
    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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

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.
 
Don't get me started about those stupid light bulbs.
 
subject: Common data type for XML in a database