Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Controlling Resul Set object to stop database process.

 
Mohan Karthick
Ranch Hand
Posts: 199
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic