O'Reilly logo

Database Programming with JDBC & Java, Second Edition by George Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Rowsets

JDBC predates the JavaBeans API. One place where JDBC could have made use of JavaBeans is in the ResultSet interface. Specifically, it would have been nice for simple two-tier applications to be able to map GUI widgets directly to a JavaBean representing data from the database. The JDBC Optional Package merges JavaBeans with result set management in a generalized fashion that is not limited to simple two-tier systems. This merger comes in the form of rowsets.

Note

In case you are not familiar with JavaBeans, it is Java’s client-side component model. By writing your client-side components to the JavaBeans specification, you make it possible for them to plug into diverse applications. The specification dictates an event model for UI events and naming conventions for your components. JavaBeans, for example, enables you to write a component such as a RowSet and have other objects that know nothing about rowsets or the concept of a RowSet listen to that RowSet component for changes.

The rowset specification, like the connection pooling specification, is not necessarily provided by your JDBC driver. Instead, third parties can implement the rowset specification by providing different layers of result set encapsulation. The obvious use is the one I outlined previously—hiding a result set behind a JavaBeans-friendly interface. It is thus likely that driver vendors will provide a rowset implementation that supports direct access to their database. Because the rowset API does not require ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required