?
Solved

Oracle error

Posted on 2003-03-29
4
Medium Priority
?
717 Views
Last Modified: 2011-10-03
Hi,

i read about you giving oracle solutions so it would be excellent if you could help me on this:

i developp an aplication with

-oracle 8i.
-apache web server
-jserv
-jbuilder for servlets

First of all, i use a pool of connections( free source by Phillip Hanna).

I get "resultset exhausted"(if you need the oracle error code i will give it to you) when i'm calling various servlets.
Of course it's not that basic error which occurs when you exceed the number of lines  ( i use while(rs.next()) ).

To be short, when i want to exacute a query i call a very simple function which:
 1. gives me the resultset of that querry and
 2. releases the connection(pool.release) it used to get a statement to exectute that query.

Then i use the resultset in a "while" loop to do different things. After the loop:
- i close the resultset
- close the statement( i am forced to close it after the loop, otherwise i could not make rs.next() )

The problem is that the step 2 of the function could block the result set i'm using in the loop. So maybe i'm trying to acces i line but the resultset can't no more becouse of what happens in the release method.

The second possibility is to use a unique static connection object. In this case I get "maximum number of cursors exceeded" which is normal if i open, say, 20 resultsets.

So, what could i do to solve this ?

Or do you have any suggestion about classic multi-user connection methods to avoid errors?

For any questions, please let me know and i'ill give you all the details you need.

Thanks!

Vlad BALAN - INSA Lyon, France

___________________________________
Here's my DB acces function :

 public static void executeQuery(String sql)throws Exception{
    try{
      Connection con=getConnection();
      Statement st=con.createStatement();
      st.execute("alter session set nls_numeric_characters='.,'");
      st.execute(sql);
      pool.releaseConnection(con);
    }
    catch(Exception e){
      System.out.println("Error trying to execute your query :\n" + sql + "\n The exception is:" +e);
      throw e;
     }

  }


  public static Connection getConnection()throws Exception{

       if(pool==null){
          pool = new ConnectionPool(new OdbcConnectionFactory(""));
        }
        return pool.getConnection();

  }




 
0
Comment
Question by:balanvlad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
Mayank S earned 300 total points
ID: 8236383
>> Connection con=getConnection();

Connection con = DriverManager.getConnection ( "jdbc:odbc:<database-name>", "username", "password" ) ;
0
 

Expert Comment

by:CleanupPing
ID: 9446669
balanvlad:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 9451830
Recommendation: Accept mayankeagle's comment as answer.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question