The single most visible addition to the JDBC API in its 2.0 specification is support for scrollable result sets. When the JDBC specification was first finalized, the specification contributors engaged in serious debate as to whether or not result sets should be scrollable. Those against scrollable result sets—and I was one of them—argued that they were antithetical to object-oriented programming and that they violated the rule that complex functionality should not encumber the most commonly used classes. In addition, requiring all driver vendors to implement scrollable result sets could adversely impact the performance of more mundane result set operations for some database engines. Scrollable result sets, on the other hand, are common in database vendor APIs, and the database vendors thus believed they should be present in JDBC.
result sets starts with the way in which you create statements.
Earlier in the chapter, you learned to create a statement using the
createStatement( ) method. The
Connection class actually
has two versions of
zero parameter version you have used so far and a two parameter
version that supports the creation of
instances that generate scrollable
objects. The default call translates to the following call:
The first argument is the result set type. The value