wood burning stoves*
The moose likes Jobs Wanted and the fly likes error in jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Careers » Jobs Wanted
Reply locked New topic
Author

error in jdbc

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
i have a jdbc class that prints same result 10000 times,but it throws exception as show
java.sql.SQLException: ORA-01000: maximum open cursors exceeded

i know i can increase max number of cursors in oracle db.but db is located somewhere else so i cant do that.the code below throws exception when value of i=300.my requirement is that loop should print resultset 10000 times without any error.Code is show below please help me.
-----code-----------------------
for(10000 times)
String qs = "select * from scheduledJobs";
stmt = con.createStatement();
rs = stmt.executeQuery(qs);
while (rs.next()){
System.out.print(rs.getString("jobid");
System.out.print(rs.getString("interfaceid"));
}
}
rs.close();
stmt.close();
con.close();
Jay Ashar
Ranch Hand

Joined: Oct 13, 2002
Posts: 208
You are in the wrong forum, your message will be moved.
Anyways, have to tried closing the statement and resultset inside the loop. Looks like you are opening statement and resultset but not closing it.


SCJP 1.4<br />SCWCD 1.3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in jdbc
 
Similar Threads
Exception Null
error in jdbc
synchronized test
retrieved data from database and tick JTextBox in my form automatically
DATABASE APPLET