This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XML record count Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML record count" Watch "XML record count" New topic
Author

XML record count

Chuck Lowry
Greenhorn

Joined: May 29, 2002
Posts: 13
I am using OracleXMLQuery to retrieve XML from our database and need to retrieve the total number of records in the XML. I am currently using the XPath count() function, but it takes too long for large queries. Is there a faster way to get the record count from the XML? Thanks.
Chuck Lowry
Greenhorn

Joined: May 29, 2002
Posts: 13
In case anyone else ever has this question...
If you are using OracleXMLQuery you can run the method getNumRowsProcessed() against your query object and return the number of rows. I'm still not sure of a better way to do it from the XML document, but if anyone has any ideas, please email me.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XML record count
 
It's not a secret anymore!