advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Download the code for this article
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Master the FilteredRowSet Interface for Disconnected Data Retrieval

The FilteredRowSet interface, added to version 1.5 of Java, lets you retrieve a custom view of database data using a filter that takes a snapshot, but doesn't alter, your table. Best of all, it does this without a persistent database connection.  


advertisement
he latest version of Java, J2SE 5.0 (version 1.5 of the JDK) is the first to deliver the concept of disconnected RowSet objects to the Java language. The FilteredRowset interface extends from the WebRowSet interface, which in turn extends from the javax.sql.Rowset interface. As you will see, the FilteredRowSet lets one narrow down the number of rows in a disconnected object based on filtering logic you provide without requiring an ongoing connection to your database. In this article, I'll introduce you to FilteredRowSet objects.

Where Oh WHERE Clause?
If you were using simple JDBC, you could achieve the same thing using a WHERE clause in a query using a JdbcRowset object. But JdbcRowset objects require a connection to the database, whereas RowSet objects (a superset of FilteredRowSet objects) do not (i.e., they are disconnected). A WHERE clause requires a connection to the database to filter your database data. With the FilteredRowSet, you can retrieve your data from the database and then disconnect. As you will see, the FilteredRowSet uses Predicate objects to retrieve data from RowSet objects without a database connection using WHERE-like logic.


It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement