Hi All:

We are using Oracle Thin Type 4 Driver with Weblogic
App Server version 5.1 for our JDBC Connections and
use Prepared Statements. We also have specified the
maximum connections to be 100 in the weblogic
properties and in our DAO's we close the
PreparedStatement, ResultSet and Connection in the
finally block. But there are STILL instances where the
connections are not being closed even when the
following code is executed:

try{
  //create connection,etc.
}catch(SQLException sqlExc){
  //handle error
}finally{
  try {
     if(rs != null){
       rs.close();
     }
     if(prepStmt != null){
       prepStmt.close();
     }
     if(con != null){
       con.close();
     }
  } catch(SQLException e) {;}
}

Problem faced: Exceeding the maximum number of
connections due to inactive open connections. Has
anyone faced this problem? 

I thought that the finally block is executed no matter
what and is the best place to close connections to
ensure a proper clean - up! Can anyone please suggest
what am I doing wrong here?

Thanks in advance.
Abhi

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to