define this code in your bean
________________________________
public void closeDBConnection()
{
try{
if(st!=null) st.close();
if(!connection.isClosed()) connection.close();
}catch(Exception e)
{ e.printStackTrace(); }
}
________________________________
and called in your
jsp as ds.closeDBConnection();