Databases Reference
In-Depth Information
Avoid getRowCount, getEstimatedRowCount
It is advised not to use getRowCount() or getEstimatedRowCount() for a view object,
as this will fetch all the rows in memory, use getCappedRowCount(n) instead.
The getCappedRowCount(n) method executes the query and a count up to n number of
rows. If the row count is less than n , it returns a posiive integer. It returns a negaive ID if
the row count is greater than n .
Working with Rowsets
When working with a view object, it is possible to open many rowsets and forget to close the
rowsets that are cleared on garbage collecion. Use the RowSet.closeRowSet() method to
close the rowset opened previously, so that you do not need to wait unil the object is garbage
collected. This would improve the performance by uilizing the space and the amount of work
done on garbage collecion.
List of values
View accessors are added to display the list of values for an atribute. For example, if you
want to show a list of values of department names instead of department IDs, you will have
to use the view accessor secion to add a view object that will list all the department names.
Time for action - creating a list of values of a department
Carry out the following steps to create a list of values:
1. Add a view accessor mapping to the DeptVO.xml file, in the EmpEO.xml file
2. Go to the EmpVO.xml file and then select the Deptno atribute.
3. Select the List of Values: secion to add a new list of values, as shown in the
following screenshot:
 
Search WWH ::




Custom Search