1 21 22 package org.dbunit.database.statement; 23 24 import java.sql.Connection ; 25 import java.sql.SQLException ; 26 27 32 public class BatchStatement extends AbstractBatchStatement 33 { 34 BatchStatement(Connection connection) throws SQLException 35 { 36 super(connection); 37 } 38 39 public void addBatch(String sql) throws SQLException 40 { 41 _statement.addBatch(sql); 42 } 43 44 public int executeBatch() throws SQLException 45 { 46 int[] results = _statement.executeBatch(); 47 int result = 0; 48 for (int i = 0; i < results.length; i++) 49 { 50 result += results[i]; 51 } 52 return result; 53 } 54 55 public void clearBatch() throws SQLException 56 { 57 _statement.clearBatch(); 58 } 59 60 } 61 62 63 64 65 66 67 | Popular Tags |