SQLServerBulkCopyOptions Class
- java.
lang. Object - com.
microsoft. sqlserver. jdbc. SQLServerBulkCopyOptions
- com.
Implements
public class SQLServerBulkCopyOptions
implements java.io.Serializable
Provides a collection of settings that control how an instance of SQLServerBulkCopy behaves. Used when constructing a SQLServerBulkCopy instance to change how the writeToServer methods for that instance behave.
Constructor Summary
Constructor | Description |
---|---|
SQLServerBulkCopyOptions() |
Constructs a SQLServer |
Method Summary
Modifier and Type | Method and Description |
---|---|
int |
getBatchSize()
Returns the number of rows in each batch. |
int |
getBulkCopyTimeout()
Returns the number of seconds for the operation to complete before it times out. |
boolean |
isAllowEncryptedValueModifications()
Returns if allow |
boolean |
isCheckConstraints()
Returns whether constraints are to be checked while data is being inserted or not. |
boolean |
isFireTriggers()
Returns if the server should fire insert triggers for rows being inserted into the database. |
boolean |
isKeepIdentity()
Returns whether or not to preserve any source identity values. |
boolean |
isKeepNulls()
Returns whether to preserve null values in the destination table regardless of the settings for default values, or if they should be replaced by default values (where applicable). |
boolean |
isTableLock()
Returns whether SQLServer |
boolean |
isUseInternalTransaction()
Returns whether each batch of the bulk-copy operation will occur within a transaction or not. |
void |
setAllowEncryptedValueModifications(boolean allowEncryptedValueModifications)
Sets whether the driver would send data as is or would decrypt the data and encrypt it again before sending to SQL Server |
void |
setBatchSize(int batchSize)
Sets the number of rows in each batch. |
void |
setBulkCopyTimeout(int timeout)
Sets the number of seconds for the operation to complete before it times out. |
void |
setCheckConstraints(boolean checkConstraints)
Sets whether constraints are to be checked while data is being inserted or not. |
void |
setFireTriggers(boolean fireTriggers)
Sets whether the server should be set to fire insert triggers for rows being inserted into the database. |
void |
setKeepIdentity(boolean keepIdentity)
Sets whether or not to preserve any source identity values. |
void |
setKeepNulls(boolean keepNulls)
Sets whether to preserve null values in the destination table regardless of the settings for default values, or if they should be replaced by default values (where applicable). |
void |
setTableLock(boolean tableLock)
Sets whether SQLServer |
void |
setUseInternalTransaction(boolean useInternalTransaction)
Sets whether each batch of the bulk-copy operation will occur within a transaction or not. |
Methods inherited from java.lang.Object
Constructor Details
SQLServerBulkCopyOptions
public SQLServerBulkCopyOptions()
Constructs a SQLServerBulkCopySettings class using defaults for all of the settings.
Method Details
getBatchSize
public int getBatchSize()
Returns the number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server.
Returns:
getBulkCopyTimeout
public int getBulkCopyTimeout()
Returns the number of seconds for the operation to complete before it times out.
Returns:
isAllowEncryptedValueModifications
public boolean isAllowEncryptedValueModifications()
Returns if allowEncryptedValueModifications option is enabled or not
Returns:
isCheckConstraints
public boolean isCheckConstraints()
Returns whether constraints are to be checked while data is being inserted or not.
Returns:
isFireTriggers
public boolean isFireTriggers()
Returns if the server should fire insert triggers for rows being inserted into the database.
Returns:
isKeepIdentity
public boolean isKeepIdentity()
Returns whether or not to preserve any source identity values.
Returns:
isKeepNulls
public boolean isKeepNulls()
Returns whether to preserve null values in the destination table regardless of the settings for default values, or if they should be replaced by default values (where applicable).
Returns:
isTableLock
public boolean isTableLock()
Returns whether SQLServerBulkCopy should obtain a bulk update lock for the duration of the bulk copy operation.
Returns:
isUseInternalTransaction
public boolean isUseInternalTransaction()
Returns whether each batch of the bulk-copy operation will occur within a transaction or not.
Returns:
setAllowEncryptedValueModifications
public void setAllowEncryptedValueModifications(boolean allowEncryptedValueModifications)
Sets whether the driver would send data as is or would decrypt the data and encrypt it again before sending to SQL Server
Use caution when specifying allowEncryptedValueModifications as this may lead to corrupting the database because the driver does not check if the data is indeed encrypted, or if it is correctly encrypted using the same encryption type, algorithm and key as the target column.
Parameters:
setBatchSize
public void setBatchSize(int batchSize)
Sets the number of rows in each batch. At the end of each batch, the rows in the batch are sent to the server.
Parameters:
Throws:
setBulkCopyTimeout
public void setBulkCopyTimeout(int timeout)
Sets the number of seconds for the operation to complete before it times out.
Parameters:
Throws:
setCheckConstraints
public void setCheckConstraints(boolean checkConstraints)
Sets whether constraints are to be checked while data is being inserted or not.
Parameters:
setFireTriggers
public void setFireTriggers(boolean fireTriggers)
Sets whether the server should be set to fire insert triggers for rows being inserted into the database.
Parameters:
setKeepIdentity
public void setKeepIdentity(boolean keepIdentity)
Sets whether or not to preserve any source identity values.
Parameters:
setKeepNulls
public void setKeepNulls(boolean keepNulls)
Sets whether to preserve null values in the destination table regardless of the settings for default values, or if they should be replaced by default values (where applicable).
Parameters:
setTableLock
public void setTableLock(boolean tableLock)
Sets whether SQLServerBulkCopy should obtain a bulk update lock for the duration of the bulk copy operation.
Parameters:
setUseInternalTransaction
public void setUseInternalTransaction(boolean useInternalTransaction)
Sets whether each batch of the bulk-copy operation will occur within a transaction or not.
Parameters: