1 21 package org.dbunit.ext.mssql; 22 23 import org.dbunit.database.DatabaseConfig; 24 import org.dbunit.database.DatabaseConnection; 25 import org.dbunit.dataset.FilteredDataSet; 26 import org.dbunit.dataset.IDataSet; 27 import org.dbunit.dataset.filter.ExcludeTableFilter; 28 import org.dbunit.dataset.filter.ITableFilter; 29 30 import java.sql.Connection ; 31 import java.sql.SQLException ; 32 33 38 public class MsSqlConnection extends DatabaseConnection 39 { 40 private final ITableFilter _filter = new ExcludeTableFilter( 41 new String [] {"dtproperties"}); 42 43 49 public MsSqlConnection(Connection connection, String schema) 50 { 51 super(connection, schema); 52 getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, 53 new MsSqlDataTypeFactory()); 54 } 55 56 61 public MsSqlConnection(Connection connection) 62 { 63 super(connection); 64 getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, 65 new MsSqlDataTypeFactory()); 66 } 67 68 71 public IDataSet createDataSet() throws SQLException 72 { 73 IDataSet dataSet = super.createDataSet(); 74 return new FilteredDataSet(_filter, dataSet); 75 } 76 77 public IDataSet createDataSet(String [] tableNames) throws SQLException 78 { 79 IDataSet dataSet = super.createDataSet(tableNames); 80 return new FilteredDataSet(_filter, dataSet); 81 } 82 } 83 | Popular Tags |