Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2010
    Posts
    3

    Unanswered: 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?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.
    Last edited by Marcus_A; 03-23-10 at 23:22.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  5. #5
    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="????"/>

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  7. #7
    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.

  8. #8
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •