balanvlad
asked on
Oracle error
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();
}
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();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Recommendation: Accept mayankeagle's comment as answer.
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.