• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Another JDOM Question

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am currently using jdom and jdom-contrib to generate xml output by passing ResultSet object to the ResultSetBuilder class. My code will be shown in the following:



However, I want to get the number of the rows that were contained from the ResultSet Object. As you know, you can count it manually one by one by using the rs.next() method, however, I think it's not efficient. I just curious that if the Document Object has some method that tells me how many dataSet that were generated.

Thanks in advance

Transistor
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ResultSet itself doesn't have any such method, mainly because it's not a meaningful question. You can't know how many rows a ResultSet will return until it has finished returning those rows. So, any method that tells you how many rows there are must read all of those rows (which means that it is efficient after all).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic