File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes insert error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "insert error" Watch "insert error" New topic

insert error

Malhar Barai
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
hi all,
On insertion, I get the following error sometimes...eventhough when I hava closed the resultsets.

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

How do I go about this.

Malhar Barai
SOA & Java Book
eammon bannon
Ranch Hand

Joined: Mar 16, 2004
Posts: 140
You can find the number of open cursors avaliable per user in Oracle with this SQL:

select * from v$parameter
where name = 'open_cursors'

Check this, make sure the DB is not set to allow a too small value for your application. If you need more, the number is defined in INITSID.ORA.
You probably want check who's opening the cursors, and if they are closing them. You can do this, but I can't remember the SQL - sorry - have a glance at the documentation there is a way to do it.
Also its not the ResultSet which opens the cursor as such, but the Statement. Make sure you are closing this, which will release any JDBC resources that are being used.

(BTW: you should really have posted this in the JDBC forum)
[ April 07, 2004: Message edited by: eammon bannon ]
I agree. Here's the link:
subject: insert error
It's not a secret anymore!