Package base.dbunit.vendors

Source Code of base.dbunit.vendors.MSSqlServerDbUnitManagerImpl

package base.dbunit.vendors;

import java.sql.SQLException;

import javax.sql.DataSource;

import org.dbunit.DatabaseUnitException;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.ext.mssql.InsertIdentityOperation;
import org.dbunit.ext.mssql.MsSqlConnection;
import org.dbunit.operation.DatabaseOperation;

import base.dbunit.DefaultDbUnitManagerImpl;

public class MSSqlServerDbUnitManagerImpl extends DefaultDbUnitManagerImpl {

  public MSSqlServerDbUnitManagerImpl(DataSource dataSource) {
    super(dataSource);
  }
 
  @Override
  protected void execute(DatabaseOperation operation, String dbUnitXmlPath) {
    operation = new InsertIdentityOperation(operation);
    super.execute(operation, dbUnitXmlPath);
  }
 
  @Override
  protected IDatabaseConnection getDbUnitConnection()
      throws DatabaseUnitException, SQLException {
    IDatabaseConnection dbconn = new MsSqlConnection(getConnection());
    return dbconn;
  }

}
TOP

Related Classes of base.dbunit.vendors.MSSqlServerDbUnitManagerImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.