public class SQLServerBulkCopyOptions
extends java.lang.Object
Constructor | Description |
---|---|
SQLServerBulkCopyOptions() |
Initializes an instance of the SQLServerBulkCopySettings class using defaults for all of the settings.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getBatchSize() |
Gets the number of rows in each batch.
|
int |
getBulkCopyTimeout() |
Gets the number of seconds for the operation to complete before it times out.
|
boolean |
isAllowEncryptedValueModifications() |
Indicates if allowEncryptedValueModifications option is enabled or not
|
boolean |
isCheckConstraints() |
Indicates whether constraints are to be checked while data is being inserted or not.
|
boolean |
isFireTriggers() |
Indicates if the server should fire insert triggers for rows being inserted into the database.
|
boolean |
isKeepIdentity() |
Indicates whether or not to preserve any source identity values.
|
boolean |
isKeepNulls() |
Indicates 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() |
Indicates whether SQLServerBulkCopy should obtain a bulk update lock for the duration of the bulk copy operation.
|
boolean |
isUseInternalTransaction() |
Indicates 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 SQLServerBulkCopy should obtain a bulk update lock for the duration of the bulk copy operation.
|
void |
setUseInternalTransaction(boolean useInternalTransaction) |
Sets whether each batch of the bulk-copy operation will occur within a transaction or not.
|
public SQLServerBulkCopyOptions()
public int getBatchSize()
public void setBatchSize(int batchSize) throws SQLServerException
batchSize
- Number of rows in each batch.SQLServerException
- If the batchSize being set is invalid.public int getBulkCopyTimeout()
public void setBulkCopyTimeout(int timeout) throws SQLServerException
timeout
- Number of seconds before operation times out.SQLServerException
- If the timeout being set is invalid.public boolean isKeepIdentity()
public void setKeepIdentity(boolean keepIdentity)
keepIdentity
- True if source identity values are to be preserved; false if they are to be assigned by the destinationpublic boolean isKeepNulls()
public void setKeepNulls(boolean keepNulls)
keepNulls
- True if null values should be preserved; false if null values should be replaced by default values where applicable.public boolean isTableLock()
public void setTableLock(boolean tableLock)
tableLock
- True to obtain row locks; false otherwise.public boolean isUseInternalTransaction()
public void setUseInternalTransaction(boolean useInternalTransaction)
useInternalTransaction
- True if the batch will occur within a transaction; false otherwise.public boolean isCheckConstraints()
public void setCheckConstraints(boolean checkConstraints)
checkConstraints
- True if constraints are to be checked; false otherwise.public boolean isFireTriggers()
public void setFireTriggers(boolean fireTriggers)
fireTriggers
- True triggers are to be enabled; false otherwise.public boolean isAllowEncryptedValueModifications()
public void setAllowEncryptedValueModifications(boolean allowEncryptedValueModifications)
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.
allowEncryptedValueModifications
- enables bulk copying of encrypted data between tables or databases, without decrypting the data. Typically, an application would
select data from encrypted columns from one table without decrypting the data (the app would connect to the database with the column
encryption setting keyword set to disabled) and then would use this option to bulk insert the data, which is still encrypted.Copyright © 2018 Microsoft Corporation. All rights reserved.