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();

}

}

}

[1198 byte] By [Evergreana] at [2007-11-27 6:05:31]
# 1
Yes close the connection in the finally block and also the statements and resultsets associated.
aniseeda at 2007-7-12 16:51:40 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...