Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.dbunit.ext.mssql
Class InsertIdentityOperation  view InsertIdentityOperation download InsertIdentityOperation.java

java.lang.Object
  extended byorg.dbunit.operation.DatabaseOperation
      extended byorg.dbunit.operation.AbstractOperation
          extended byorg.dbunit.ext.mssql.InsertIdentityOperation

public class InsertIdentityOperation
extends org.dbunit.operation.AbstractOperation

This class disable the MS SQL Server automatic identifier generation for the execution of inserts.

If you are using the Microsoft driver (i.e. com.microsoft.jdbc.sqlserver.SQLServerDriver), you'll need to use the SelectMethod=cursor parameter in the JDBC connection string. Your databaseUrl would look something like the following:

jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb;SelectMethod=cursor

Thanks to Jeremy Stein how have submited multiple patches.

Since:
Apr 9, 2002
Version:
$Revision: 1.5 $

Nested Class Summary
 
Nested classes inherited from class org.dbunit.operation.DatabaseOperation
 
Field Summary
private  org.dbunit.operation.DatabaseOperation _operation
           
static org.dbunit.operation.DatabaseOperation CLEAN_INSERT
           
private static org.dbunit.dataset.filter.IColumnFilter DEFAULT_IDENTITY_FILTER
           
static org.dbunit.operation.DatabaseOperation INSERT
           
static java.lang.String PROPERTY_IDENTITY_COLUMN_FILTER
           
static org.dbunit.operation.DatabaseOperation REFRESH
           
 
Fields inherited from class org.dbunit.operation.DatabaseOperation
DELETE, DELETE_ALL, NONE, TRUNCATE_TABLE, UPDATE
 
Constructor Summary
InsertIdentityOperation(org.dbunit.operation.DatabaseOperation operation)
          Creates a new InsertIdentityOperation object that decorates the specified operation.
 
Method Summary
 void execute(org.dbunit.database.IDatabaseConnection connection, org.dbunit.dataset.IDataSet dataSet)
          Executes this operation on the specified database using the specified dataset contents.
private  boolean hasIdentityColumn(org.dbunit.dataset.ITableMetaData metaData, org.dbunit.database.IDatabaseConnection connection)
           
 
Methods inherited from class org.dbunit.operation.AbstractOperation
getQualifiedName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_IDENTITY_COLUMN_FILTER

public static final java.lang.String PROPERTY_IDENTITY_COLUMN_FILTER
See Also:
Constant Field Values

INSERT

public static final org.dbunit.operation.DatabaseOperation INSERT

CLEAN_INSERT

public static final org.dbunit.operation.DatabaseOperation CLEAN_INSERT

REFRESH

public static final org.dbunit.operation.DatabaseOperation REFRESH

DEFAULT_IDENTITY_FILTER

private static final org.dbunit.dataset.filter.IColumnFilter DEFAULT_IDENTITY_FILTER

_operation

private final org.dbunit.operation.DatabaseOperation _operation
Constructor Detail

InsertIdentityOperation

public InsertIdentityOperation(org.dbunit.operation.DatabaseOperation operation)
Creates a new InsertIdentityOperation object that decorates the specified operation.

Method Detail

hasIdentityColumn

private boolean hasIdentityColumn(org.dbunit.dataset.ITableMetaData metaData,
                                  org.dbunit.database.IDatabaseConnection connection)
                           throws org.dbunit.dataset.DataSetException

execute

public void execute(org.dbunit.database.IDatabaseConnection connection,
                    org.dbunit.dataset.IDataSet dataSet)
             throws org.dbunit.DatabaseUnitException,
                    java.sql.SQLException
Description copied from class: org.dbunit.operation.DatabaseOperation
Executes this operation on the specified database using the specified dataset contents.