A FilteredRowSet object contains only the filtered rows from the database. The filter criteria is set in the RowSet object and the RowSet only get the filtered data from the database to the object. The filters can ebe created by implemeting Predicate interface. The following example will demonstrate the filter object creationg and how to apply the filters in the RowSet object.
package com.visualbuilder; import java.sql.SQLException; import javax.sql.RowSet; import com.sun.rowset.FilteredRowSetImpl; class Filter1 implements Predicate { public Filter1(String colName) { public boolean evaluate(RowSet rs) { public boolean evaluate(Object arg0, int arg1) throws SQLException { return false; public boolean evaluate(Object arg0, String arg1) throws SQLException { return false; public class FillterRowSetExample { Output:- Employee is Adam Department is Sales Employee is Adran Department is Marketing | |
Java Discussion
- - Interviewing Next week -
- - Sudoku solver
- - Setting tab order in swin
- - Java opportunities
- - Struts



