Daniel John Debrunner wrote:
David Van Couvering wrote:
Wow, great work Army, and thanks for the careful review and effort by
Brian and Yip! It's great to have this in. If I could only grok
exactly what the feature is and how I might use it :) I am telling
people "we have XML features" and I know it's something to do with
XQuery and XPath, but I couldn't say what.
I was messing with the XML support last night for buddy testing and it's
very cool. Three new Derby features combined together to make the
application development easier:
1) XML support
2) CALL procedure in trigger
3) Lengthless overrides for PreparedStatement.setCharacterStream
OK - I didn't test 3) cos I would have to set up Xalan for Mustang and I
didn't want to spend time on how to figure that out, but it would have
been useful.
Hi Dan,
This sounds really cool :)
Any change you can share your trigger procedure?
Then maybe someone else can take on the work to test the new lengthless
overrides added by JDBC 4.0. I don't think they have received much
testing yet. They are now in the 10.2 branch, but I believe they are not
(fully) included in the latest beta (10.2.1.1). I'll add an entry to the
buddy testing page when the time is right.
Regards,
--
Kristian
I setup a table with a column that contained a URL as a VARCHAR and an
XML column, a procedure in an INSERT trigger then fetched the data from
the URL and updated the XML column using XMLPARSE, streaming directly
from the remote site using setCharacterStream.
I used this to download DERBY Jira issues, each row holds an XML
document that corresponds to a single Jira issue. E.g. from
http://issues.apache.org/jira/browse/DERBY-434?decorator=none&view=rss
Then I can execute queries against the issues locally, using XPath (and
SQL).
-- Sequence of all comments made by Sunitha against bugs reported by me
-- wd_id is the DERBY-XXX identifier
-- wd_accesstime is the time the data was downloaded from the web.
-- wd_content is the XML column
select wd_id, wd_accesstime,
XMLSERIALIZE(
XMLQUERY('//item/comments/[EMAIL PROTECTED]"skambha"]' PASSING BY REF
wd_content EMPTY ON EMPTY)
AS VARCHAR(30000))
from wdd.web_docs where
XMLEXISTS('//reporter[text() = "Daniel John Debrunner"]' PASSING BY REF
wd_content);
-- Jira status of all bugs entered by me
select wd_id,
XMLSERIALIZE(
XMLQUERY('//item/status/text()' PASSING BY REF wd_content EMPTY ON EMPTY)
AS VARCHAR(20)),
wd_accesstime
from wdd.web_docs where
XMLEXISTS('//reporter[text() = "Daniel John Debrunner"]' PASSING BY REF
wd_content)
order by 2,1;
I'll think I wil expand this to use it in my talk at ApacheCon US.
Dan.