-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLServerBulkCopy does not accept the ISQLServerConnection during initialization while running in websphere liberty server #1072
Comments
I downloaded
|
Can you share me your Java code to reproduce error as well? |
|
Looks like you're providing an object of Is there a specific requirement where you need to pass this implemented class object, and could you pass |
App server created the My scenario is quite similar to the example at https://docs.microsoft.com/en-us/sql/connect/jdbc/wrappers-and-interfaces?view=sql-server-2017#interfaces. Is SQLServerBulkCopy not supposed to handle the SQLServerConnection wrapped by the application server? |
Driver version
sqljdbc42.jar
SQL Server version
SQL Server 2014
Client Operating System
Windows 10
JAVA/JVM version
JDK 1.8
Table schema
I wanna just store the complete raw data directly from a text file to the corresponding columns using SQLServerBulkCopy API, so I have not kept any keys (primary/unique/foreign) for my table
Problem description
I am using SQLServerBulkCopy API to store millions of records. My app runs in websphere-liberty. I use SQLServerConnectionPoolDataSource. So when I try to pass the connection to the bulkCopy like
SQLServerBulkCopy bulkCopy = new SQLServerBulkCopy(conn);
I get an exception stating
com.microsoft.sqlserver.jdbc.SQLServerException: Destination connection must be a connection from the Microsoft JDBC Driver for SQL Server.
where the
conn
is unwrapped usingISQLServerConnection
interface from app server created connection namelyWsJdbcConnection
.But passing a physical connection using the connection url to the SQLServerBulkCopy works good.
Reproduction code
The text was updated successfully, but these errors were encountered: