File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes RowCount in FilteredRowSet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "RowCount in FilteredRowSet" Watch "RowCount in FilteredRowSet" New topic
Author

RowCount in FilteredRowSet

Feyna Reendrina
Greenhorn

Joined: Apr 18, 2006
Posts: 11
i want to make the table model using FilteredRowSet, but i have some problem to get row count...

method size of FilteredRowSet, can not be used!! beacuse it will be return count of record in FilteredRowSet that inserted and deleted....

what i want is to get count of active record (no deleted record)...

i using this script to claculate...
but it will be always SQLException when reach the last record, if i delete the last record!!

Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

I haven't use FilteredRowSet, only I can suggest as of now you keep a counter in your program, whenever you delete a row increment the counter.
So at any point of time you can get active rows as crs.size() - deletedRows

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://jrebel.com/download
 
subject: RowCount in FilteredRowSet
 
Similar Threads
ThreadUnsafe
Using FileChannel instead of RandomAccessFile
Why getProperty values a different data records
Invisible JTable Column Header!
delete row from Jtable using AbstractTableModel