<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>NewPush &#187; XQuery</title> <atom:link href="http://newpush.com/tag/xquery/feed/" rel="self" type="application/rss+xml" /><link>http://newpush.com</link> <description>Server Hosting, Data Warehouse Hosting, Collaboration</description> <lastBuildDate>Wed, 23 May 2012 03:47:03 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Register DTD for pureXML with DB2 9.7</title><link>http://newpush.com/2009/12/register-dtd-for-purexml-with-db2-9-7/</link> <comments>http://newpush.com/2009/12/register-dtd-for-purexml-with-db2-9-7/#comments</comments> <pubDate>Thu, 17 Dec 2009 13:51:14 +0000</pubDate> <dc:creator>Balazs</dc:creator> <category><![CDATA[DB2]]></category> <category><![CDATA[DB2 9.7]]></category> <category><![CDATA[DTD]]></category> <category><![CDATA[IBM]]></category> <category><![CDATA[pureXML]]></category> <category><![CDATA[XML]]></category> <category><![CDATA[XML Schema]]></category> <category><![CDATA[XQuery]]></category><guid isPermaLink="false">http://www.wdream.com/?p=434</guid> <description><![CDATA[Problem Even though XML schema has been around for a decade, still many APIs reference a DTD in the XML documents sent back and fourth. Such is the OpenSRS API. DB2 requires an XML schema or a DTD to be &#8230; <a href="http://newpush.com/2009/12/register-dtd-for-purexml-with-db2-9-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<h4>Problem</h4><p>Even though XML schema has been around for a decade, still many APIs reference a DTD in the XML documents sent back and fourth.  Such is the <a href="http://opensrs.com/resources/documentation/opensrsapixml/index.htm">OpenSRS API</a>. <b>DB2</b> requires an XML schema or a DTD to be registered before it will process XML documents that refer to an XML Schema or a DTD.  The process of registering such XSROBJECTs with DB2 has changed in DB2 since version 8.</p><h4>Solution</h4><ul><li>register a DTD using the DB2 9.7 command line:<code><br /> db2 CONNECT TO SAMLE<br /> db2 REGISTER XSROBJECT 'dtd-file-name.dtd' FROM /path/to/dtd/file AS sample.dtd-name DTD<br /> </code><br /> If the command is successful, the output is<code><br /> DB20000I  The REGISTER XSROBJECT command completed successfully.<br /> </code></li><li>Register a DTD from a Java program:<code><br /> String schemaName = "SAMPLE";<br /> String dtdName = "dtd-name";<br /> String dtdFile = "dtd-file-name.dtd";<br /> Reader fis = new FileReader(dtdFile);<br /> byte[] contentDtd = FileIO.readerToString(fis).getBytes();<br /> String registerProcQuery = "CALL SYSPROC.XSR_DTD (?,?,?,?,?)";<br /> PreparedStatement registerProcStatement = conn.prepareCall(registerProcQuery);<br /> registerProcStatement.setString(1, schemaName);<br /> registerProcStatement.setString(2, dtdName);<br /> registerProcStatement.setString(3, dtdFile);<br /> registerProcStatement.setString(4, "PUBLIC ID");<br /> registerProcStatement.setObject(5, contentDtd, java.sql.Types.BLOB);<br /> registerProcStatement.execute();<br /> </code><br /> The <code>FileIO</code> class can be found in <a href="http://www.amazon.com/gp/product/0596007019?ie=UTF8&#038;tag=wdr-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596007019">Java Cookbook, Second Edition</a><img src="http://www.assoc-amazon.com/e/ir?t=wdr-20&#038;l=as2&#038;o=1&#038;a=0596007019" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></li></ul><h4>References</h4><ul><li><a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.admin.cmd.doc/doc/r0023563.html">DB2 9.7 Documentation: REGISTER XSROBJECT</a></li><li><a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.sql.ref.doc/doc/c0024419.html">DB2 9.7 Documentation: XSR_DTD procedure</a></li><li><a href="http://www.amazon.com/gp/product/0738418773?ie=UTF8&#038;tag=wdr-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0738418773">Redbook with Media : DB2 Java Stored Procedures Learning by Example (IBM Redbook)</a><img src="http://www.assoc-amazon.com/e/ir?t=wdr-20&#038;l=as2&#038;o=1&#038;a=0738418773" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></li><li><a href="http://www.amazon.com/gp/product/0596007019?ie=UTF8&#038;tag=wdr-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596007019">Java Cookbook, Second Edition</a><img src="http://www.assoc-amazon.com/e/ir?t=wdr-20&#038;l=as2&#038;o=1&#038;a=0596007019" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></li></ul><p><center><iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=wdr-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0596007019" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe> <iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=wdr-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=0738418773" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe><br /></center></p> ]]></content:encoded> <wfw:commentRss>http://newpush.com/2009/12/register-dtd-for-purexml-with-db2-9-7/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>XQuery and pureXML in DB2</title><link>http://newpush.com/2009/05/xquery-and-purexml-in-db2/</link> <comments>http://newpush.com/2009/05/xquery-and-purexml-in-db2/#comments</comments> <pubDate>Sun, 31 May 2009 18:47:59 +0000</pubDate> <dc:creator>Balazs</dc:creator> <category><![CDATA[DB2]]></category> <category><![CDATA[DB2 9.5]]></category> <category><![CDATA[IBM]]></category> <category><![CDATA[pureXML]]></category> <category><![CDATA[XQuery]]></category><guid isPermaLink="false">http://www.wdream.com/?p=299</guid> <description><![CDATA[I just came across the following two articles that have some good pointers for using the native XML capabilities of DB2: Using DB2 XQuery to extract data mining results stored as PMML: this article is a great introduction to XQuery &#8230; <a href="http://newpush.com/2009/05/xquery-and-purexml-in-db2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I just came across the following two articles that have some good pointers for using the native XML capabilities of <b>DB2</b>:</p><ul><li><a href="http://www.ibm.com/developerworks/data/library/techarticle/dm-0905dataminingxquery/index.html?ca=drs-">Using DB2 XQuery to extract data mining results stored as PMML</a>: this article is a great introduction to XQuery and Predictive Model Markup Language (PMML), a language to describe data mining models and to enable the exchange of mining models between different data mining providers.</li><li><a href="http://www.ibm.com/developerworks/db2/library/techarticle/dm-0610nicola/">15 best practices for pureXML performance in DB2</a>: this article has valuable performance optimization advice that goes beyond the regular performance advice already covered in <a href="http://www.ibm.com/developerworks/aix/library/au-DB2AIXPERF.html">DB2 and AIX tuning essentials for DB2 performance</a>.</li></ul> ]]></content:encoded> <wfw:commentRss>http://newpush.com/2009/05/xquery-and-purexml-in-db2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: newpush.com @ 2012-05-23 06:42:19 by W3 Total Cache -->
