1 21 22 package org.dbunit.database.statement; 23 24 import org.dbunit.database.IDatabaseConnection; 25 26 import java.sql.SQLException ; 27 28 33 public class StatementFactory extends AbstractStatementFactory 34 { 35 public IBatchStatement createBatchStatement(IDatabaseConnection connection) 36 throws SQLException 37 { 38 if (supportBatchStatement(connection)) 39 { 40 return new BatchStatement(connection.getConnection()); 41 } 42 else 43 { 44 return new SimpleStatement(connection.getConnection()); 45 } 46 } 47 48 public IPreparedBatchStatement createPreparedBatchStatement(String sql, 49 IDatabaseConnection connection) throws SQLException 50 { 51 return new BatchStatementDecorator(sql, createBatchStatement(connection)); 52 } 53 54 } 55 56 57 58 59 | Popular Tags |