|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Getting the number of rows in a table
I am looking to get the number of rows in a table however I can't seem to find any methods through the ResultSet and ResultSetMetaData classes .
Does anybody here know how to do get that info ? thanks
__________________
FreeBSD , dooing more with less since 10 years ago |
|
#2
|
|||
|
|||
|
As far as I know the only way to get the number of records in a resultset is to read through the whole resultset and count (put the info in a collection so you can read through it again if need be) or make a seperate query (or as a returned field if you want)using the COUNT(*) database function.
|
|
#3
|
|||
|
|||
|
thanx , yea count works fine enough ( i was expecting it to be slower )
|
|
#4
|
|||
|
|||
|
hmm i think i found an even faster way of dooing this . Since i like keeping sequences tied up to my row numbers i simply do
select currval('sequence_of_hugetable') and get the last row's nr ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Getting the number of rows in a table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|