ConnectionLess or ConnectionOriented ResultSet

I

indo3

Hello,
In JDBC, ResultSet represents a select-result-table from a select-sql-statement
to a database. Question: does ResultSet need an active connection to
the database or is the contents "offline"?
In .NET, there are two approaches: IDataReader for fetching
the next result online, or DataSet for fetching all content and then
going offline if one like. Dont know where to put ResultSet, any idea?

THANKS
 
J

John C. Bollinger

indo3 said:
Hello,
In JDBC, ResultSet represents a select-result-table from a select-sql-statement
to a database. Question: does ResultSet need an active connection to
the database or is the contents "offline"?
In .NET, there are two approaches: IDataReader for fetching
the next result online, or DataSet for fetching all content and then
going offline if one like. Dont know where to put ResultSet, any idea?

java.sql.ResultSet is an interface. It is possible to create
implementations that are not associated with a database at all (while
still fulfilling the ResultSet contract). If a ResultSet is obtained
from a database, however, (by means of a Statement) then the Statement
must remain open -- because closing it closes the ResultSet -- and thus
the Connection must remain open (because closing it closes the
Statement). Many ResultSet implementations do not assume that they
should buffer the whole result table in memory, and instead load rows
from the DB as needed (perhaps buffering a small number of rows).
Specific implementations may offer options to control this behavior, and
don't neglect the ResultSet.setFetchSize() method.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,242
Latest member
KendrickKo

Latest Threads

Top