File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Controlling Resul Set object to stop database process. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Controlling Resul Set object to stop database process." Watch "Controlling Resul Set object to stop database process." New topic
Author

Controlling Resul Set object to stop database process.

Mohan Karthick
Ranch Hand

Joined: Apr 11, 2005
Posts: 199
suppose our JDBC result set object is retreving 10000 rows. Now certainly we got requirement that we need only 100 rows out of these 10000 rows, and we don't want to change the SQL.

So if we start iterating a result object and just after getting 100 records we break the loop and close the statement object and result set object. Is it going to stop the process at database server also. Some one says that process will keep on going on database side use excessive resources.
We don't want to create another connection by closing the connection, because we need to start another database process after the iteration break of 100 rows.

Please Advice
Thanks,
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1135

Mohan,
You said...

We don't want to create another connection by closing the connection

That's what they invented connection pools for!

Good Luck,
Avi.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Controlling Resul Set object to stop database process.