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();
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.