1 21 22 package org.dbunit.operation; 23 24 import org.dbunit.DatabaseUnitException; 25 import org.dbunit.database.IDatabaseConnection; 26 import org.dbunit.dataset.IDataSet; 27 28 import java.sql.SQLException ; 29 30 37 public class CloseConnectionOperation extends DatabaseOperation 38 { 39 private final DatabaseOperation _operation; 40 41 45 public CloseConnectionOperation(DatabaseOperation operation) 46 { 47 _operation = operation; 48 } 49 50 53 public void execute(IDatabaseConnection connection, 54 IDataSet dataSet) throws DatabaseUnitException, SQLException 55 { 56 try 57 { 58 _operation.execute(connection, dataSet); 59 } 60 finally 61 { 62 connection.close(); 63 } 64 } 65 } 66 67 68 69 70 71 | Popular Tags |