File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Careers » Jobs Wanted
Reply locked New topic

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 requirement is that loop should print resultset 10000 times without any error.Code is show below please help me.
for(10000 times)
String qs = "select * from scheduledJobs";
stmt = con.createStatement();
rs = stmt.executeQuery(qs);
while ({
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:
subject: error in jdbc
It's not a secret anymore!