I have a web application based on MySQL Database.
It works fine but sometines I receive an error message that said me that I have overlapped connection number limit.
I try to close it but it doesn't work.
This is an example of code of my DataAccessObject:
...............
public void insertRow(String PBS,String lev1,String lev2,
String lev3,String lev4) {
Collection results = new ArrayList();
final String INSERT_ROW= "INSERT INTO " +ini.FilePBS()+
" (PBS,NOMELEV1,NOMELEV2,NOMELEV3,NOMELEV4,BUDGETJR,BUDGETSR,BUDGETMG,"+
"ENDEXMJR,ENDEXMSR,ENDEXMMG) "+
"values('"+PBS+"','"+lev1+"','"+lev2+"','"+lev3+"','"+lev4+
"','0','0','0','0','0','0')";
Connection con = _connectionPool.getConnection();
try{
Statement stmt = con.createStatement();
stmt.executeUpdate(INSERT_ROW);
System.out.println(INSERT_ROW);
stmt.close();
_connectionPool.closeConnection(con);
con.close();
}
catch(SQLException ex){
System.out.println(ex);
}
finally{
try{
Statement stmt=con.createStatement();
stmt.close();
con.close();}
catch(SQLException ex2){
System.out.println(ex2);
}
}
}
...........
bye