Problems Retrieving txt file using BufferedReader

I have some problem regarding my code.  I am trying to retrive data from a .txt file using BufferedReader. It is taking up to 100 lines and givime the exception ....

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

Please any one of you give me the solution.   Its very urgent..............

Thanking you all

Raju

This is not because of reading the file and getting the data from it. It is only because of the SQL error. The problem could be

1. If you have not closed the prepared statement.

2. If you have not closed the result set

3. Finally if the database connections are not closed properly.
Try to close the db connection in the finally block rather than closing in try block. As the finally block will be executed at any cost and will close all the statements, record set and db connection.

4. Try to make use of the connection pooling .

I hope these points will help you in solving the problem.

Nanda

I think this error because you are not closing the opened connection.
Make sure that 'objConnection.close(); ' is calling in your code.

Pramod

Hi Pramod,

Thank you for your kind reply. I got my problem solved. I forgot to close statement before connection . Once again thanks for your co-op....

Raju

Do you have a Java Problem?
Ask It in The Java Forum

Java Books
Java Certification, Programming, JavaBean and Object Oriented Reference Books

Return to : Java Programming Hints and Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.