A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
NEED FOR CONNECTION OBJECT
Joined: Sep 23, 2005
Dec 12, 2005 03:18:00
For iterating a resultset , why there is a need for a connection object after the resultset is being returned by executeQuery(sqlQuery) ?
rs = stmt.executeQuery("select * from emp");
while( rs.next() )
It throws an Exception .
Joined: Mar 06, 2001
Dec 12, 2005 03:44:00
For your information, writing completely in capital letters is 'shouting' and is often considered rude.
ResultSets do not read all of the results from the query, and they need the Connection so that they are able to go back and read more results when required.
I agree. Here's the link:
subject: NEED FOR CONNECTION OBJECT
ResultSet and connection
to store the form data temporarily at client side
open Resultset and closed connection
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013