Database connection and closing
I have a connection to a Oracle Database but it doesnt seem to close the connection because the Oracle DBA says I have open connections still active. Please advise how I would properly close a connection that was opened using an object reference (dbconnection) variable:
CityDB dbconnection =new CityDB();//using no arg default constructor that is connecting to the Oracle database.
// do stuff with db here
try{
//call CityDB methods here
}
catch(Exception e){
System.out.prinln(e);
}
finally
{
if( dbconnection !=null )
{
dbconnection.close();
}
}
}

