Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML record count" Watch "XML record count" New topic

XML record count

Chuck Lowry

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

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.
jQuery in Action, 2nd edition
subject: XML record count
Similar Threads
locking and unlocking mechanism
Hibernate should hit db every single time
Formatting xml using java
jdbc and servlets
getting recordCount from ResultSet object ?