This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes ORA 01001 : Invalid Cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ORA 01001 : Invalid Cursor" Watch "ORA 01001 : Invalid Cursor" New topic
Author

ORA 01001 : Invalid Cursor

Vinicius Carvalho
Ranch Hand

Joined: Dec 07, 2004
Posts: 61
Hello there!
I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple:
SELECT email from USERS; single column, indexed on Oracle 10g.
Problem is: 1.98 million results.
Well, running this query using a tool like SquirrelSQL (pure java) it does run (ok, I dunno what kind of parameters it use to maybe limit the size of the query return)
But truth is, when I run this (I'm using Spring with JDBC here), as soon as I hit: rs.next(); I get this exception.
Is there a way to avoid this? I've checked Oracle's docs and it says that it's caused because there's too many opened cursors. I'm stupid on this, but a single connection has more than one cursor?

Any ideas on how can I fetch such huge amount of data?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Vinicius,
Are you closing the connection/statement/resultset when you are done with it? Maybe cursors are open from the previous query?

I suggest doing some experimentation to see when you are hitting this problem. You could always do this query in multiple shots (all e-mail beginning with A, B, C, ... to limit results.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
shrikant yaduvanci
Greenhorn

Joined: Jul 23, 2006
Posts: 1
Originally posted by Vinicius Carvalho:
Hello there!
I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple:
SELECT email from USERS; single column, indexed on Oracle 10g.
Problem is: 1.98 million results.
Well, running this query using a tool like SquirrelSQL (pure java) it does run (ok, I dunno what kind of parameters it use to maybe limit the size of the query return)
But truth is, when I run this (I'm using Spring with JDBC here), as soon as I hit: rs.next(); I get this exception.
Is there a way to avoid this? I've checked Oracle's docs and it says that it's caused because there's too many opened cursors. I'm stupid on this, but a single connection has more than one cursor?

Any ideas on how can I fetch such huge amount of data?



well first of all increase ur table space.
1 drop table space
2 increase tablespace
3 refer oracle 9i doc


srikant
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
as soon as I hit: rs.next(); I get this exception.


Sounds like the sql failed to execute and the recordset is not in a valid state. Is there a previous exception thrown that is being supressed? Possibly from the execute? Or is there another exception chained to this one?

That exception may give more information as to what caused the problem.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ORA 01001 : Invalid Cursor
 
Similar Threads
ResultSet--Can not able to get the value of the column
Properties File For Oracle
large resultset connection times out
Getting Null Cursor
Problem in Listening to Key events in JTable