If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Store XML file to DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-23-10, 21:17
garollous garollous is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
Store XML file to DB2

Hi Team,

I have a requirement to store an "java Object" or "XML" file to a table in DB2 v 8.1. The XML file can be of max size 100kb

Can you please suggest a db2 column type I should use?
Reply With Quote
  #2 (permalink)  
Old 03-23-10, 22:17
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
You should use CLOB for that. Be aware that LOB columns don't perform as well as other column types because they do not make use of the Bufferpool memory caching.

If you can limit it to about 32000, you could use VARCHAR, but your tablespace and bufferpool pagesize would need to be 32K.

Do not use LONG VARCHAR, which is being depricated in future releases, and functions like a LOB but is limited ot 32K.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 03-23-10 at 22:22.
Reply With Quote
  #3 (permalink)  
Old 03-24-10, 16:15
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
You may want to see the features of XML Extender as well ...
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 03-24-10, 18:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Quote:
Originally Posted by sathyaram_s View Post
You may want to see the features of XML Extender as well ...
XML Extender has been deprecated, meaning that support for it will stop in some future release (the exact release this will happen has not been specified yet by IBM).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #5 (permalink)  
Old 03-24-10, 18:29
garollous garollous is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
Thank you very much. I will then try the CLOB option as the file can be up to 1MB.

By any chance do you know the type we must use when saving the data to table using hibernate for CLOB.

Below what do we specify at ???.. should we just specify String and convert XML file to String and save it?
<property column="MyXML" name="myXML" type="????"/>
Reply With Quote
  #6 (permalink)  
Old 03-24-10, 18:34
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 03-24-10, 18:36
garollous garollous is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
That is a excellent link.. Thank you. I will set the value to text and see what happens.. will try it today for sure.
Reply With Quote
  #8 (permalink)  
Old 03-24-10, 18:41
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Quote:
Originally Posted by garollous View Post
That is a excellent link.. Thank you. I will set the value to text and see what happens.. will try it today for sure.
power of google.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On