|
47 | 47 | import java.util.logging.Level;
|
48 | 48 |
|
49 | 49 | import javax.sql.RowSet;
|
| 50 | +import javax.sql.XAConnection; |
50 | 51 |
|
51 | 52 | import microsoft.sql.DateTimeOffset;
|
52 | 53 |
|
@@ -270,13 +271,15 @@ class BulkColumnMetaData {
|
270 | 271 | public SQLServerBulkCopy(Connection connection) throws SQLServerException {
|
271 | 272 | loggerExternal.entering(loggerClassName, "SQLServerBulkCopy", connection);
|
272 | 273 |
|
273 |
| - if (null == connection || !(connection instanceof SQLServerConnection)) { |
| 274 | + if (null == connection || !(connection instanceof ISQLServerConnection)) { |
274 | 275 | SQLServerException.makeFromDriverError(null, null,
|
275 | 276 | SQLServerException.getErrString("R_invalidDestConnection"), null, false);
|
276 | 277 | }
|
277 | 278 |
|
278 | 279 | if (connection instanceof SQLServerConnection) {
|
279 | 280 | this.connection = (SQLServerConnection) connection;
|
| 281 | + } else if (connection instanceof SQLServerConnectionPoolProxy) { |
| 282 | + this.connection = ((SQLServerConnectionPoolProxy) connection).getWrappedConnection(); |
280 | 283 | } else {
|
281 | 284 | SQLServerException.makeFromDriverError(null, null,
|
282 | 285 | SQLServerException.getErrString("R_invalidDestConnection"), null, false);
|
@@ -1962,9 +1965,9 @@ private void writeColumnToTdsWriter(TDSWriter tdsWriter, int bulkPrecision, int
|
1962 | 1965 | bulkJdbcType = java.sql.Types.VARBINARY;
|
1963 | 1966 | }
|
1964 | 1967 | /*
|
1965 |
| - * if source is encrypted and destination is unencrypted, use destination sql type to send since there is no |
1966 |
| - * way of finding if source is encrypted without accessing the resultset, send destination type if source |
1967 |
| - * resultset set is of type SQLServer and encryption is enabled |
| 1968 | + * if source is encrypted and destination is unencrypted, use destination sql type to send since there is no way |
| 1969 | + * of finding if source is encrypted without accessing the resultset, send destination type if source resultset |
| 1970 | + * set is of type SQLServer and encryption is enabled |
1968 | 1971 | */
|
1969 | 1972 | else if (null != sourceCryptoMeta) {
|
1970 | 1973 | bulkJdbcType = destColumnMetadata.get(destColOrdinal).jdbcType;
|
|
0 commit comments