Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disconnected recordsets supported in JDBC? 1

Status
Not open for further replies.

entaroadun

Programmer
Sep 27, 2002
583
US
This is a simple question, but I am new to Java.

I am prototyping an application in java using a standard 3-tier design. I'd like the application layer to retrieve data from the data layer via ResultSet objects that get passed back from the data layer.

In Visual Basic, this is straightforward: I would create an ADO recordset, disconnect it from the database, then return it.

However, I have read that ResultSets are bound to the Statements that created them, therefore, if the Statement closes, the ResultSet goes away. I cannot use ResultSets to return data, since the Statement object that created the ResultSet will go out of scope at the end of the method call (the data objects are transaction-based and therefore stateless).

Does this mean that I have to create a custom class to hold the data for transport from the data layer to the app layer? I'd like to use the standard JDBC object if possible.

Implementing an XML translate would be a little out of scope for this prototype.

Thanks!
 
See (This book is of 1999) !!! :


Quote :
"Although anyone can implement a rowset, most implementations will probably be provided by vendors offering RowSet classes designed for fairly specific purposes. To make writing an implementation easier, the Java Software division of Sun Microsystems, Inc., plans to provide reference implementations for three different styles of rowsets in the future. The following list of planned implementations gives you an idea of some of the possibilities.

A CachedRowSet class—a disconnected rowset that caches its data in memory; not suitable for very large data sets, but an ideal way to provide thin Java clients, such as a Personal Digital Assistant (PDA) or Network Computer (NC), with tabular data."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top