• 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

Help Urgent

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, java Ranchers
i want to get the count of the rows in the resultSet without
iterating through the resultset.next()
any suggestion is welcome!
thanx!!
------------------
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two suggestions:
Either perform the query as a count(*) first to get the number returned then perform the real query (ie make two queries, less efficient but not too bad if you do it efficiently)
Or, if you have a driver that supprts JDBC2.0 or later, you can jump to the end of the ResultSet and find out what row number that is.
Dave.
 
Hrithik Roshan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David O'Meara:
Two suggestions:
Either perform the query as a [b]count(*)
first to get the number returned then perform the real query (ie make two queries, less efficient but not too bad if you do it efficiently)
Or, if you have a driver that supprts JDBC2.0 or later, you can jump to the end of the ResultSet and find out what row number that is.
Dave.[/B]


thanx Dave!!
//:~
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic