File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed
src/main/java/com/microsoft/sqlserver/jdbc Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -189,18 +189,7 @@ else if (dateTimeFormatter != null)
189
189
case Types .LONGVARCHAR :
190
190
case Types .NCHAR :
191
191
case Types .NVARCHAR :
192
- case Types .LONGNVARCHAR : {
193
- /*
194
- * If string data comes in as a byte array through setString (and sendStringParametersAsUnicode = false)
195
- * through Bulk Copy for Batch Insert API, convert the byte array to a string.
196
- * If the data is already a string, return it as is.
197
- */
198
- if (data instanceof byte []) {
199
- return new String ((byte []) data , charset );
200
- }
201
- return data ;
202
- }
203
-
192
+ case Types .LONGNVARCHAR :
204
193
case Types .DATE :
205
194
case Types .CLOB :
206
195
default : {
Original file line number Diff line number Diff line change @@ -2063,7 +2063,8 @@ else if (type.isBinary()) {
2063
2063
// then do the conversion now so that the decision to use a "short" or "long"
2064
2064
// SSType (i.e. VARCHAR vs. TEXT/VARCHAR(max)) is based on the exact length of
2065
2065
// the MBCS value (in bytes).
2066
- else if (null != collation && (JDBCType .CHAR == type || JDBCType .VARCHAR == type
2066
+ // If useBulkCopyForBatchInsert is true, conversion to byte array is not done due to performance
2067
+ else if ((con .getUseBulkCopyForBatchInsert () == false ) && null != collation && (JDBCType .CHAR == type || JDBCType .VARCHAR == type
2067
2068
|| JDBCType .LONGVARCHAR == type || JDBCType .CLOB == type )) {
2068
2069
byte [] nativeEncoding = null ;
2069
2070
You can’t perform that action at this time.
0 commit comments