-
Notifications
You must be signed in to change notification settings - Fork 443
Added new connection string property prepareMethod to toggle use of sp_prepare #1719
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
Conversation
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResource.java
Outdated
Show resolved
Hide resolved
|
My only thought as I skimmed this was, is a boolean, useSpPrepExec, a good way to control this option? Or should we use a string value? My thinking it that there might be a different way we want to control preparation in the future and if we use a string value, we can easily add another option without a breaking change. For example, jTDS has the prepareSQL option with 4 values (it doesn't exactly match up to what we are doing but the idea is similar): http://jtds.sourceforge.net/faq.html Perhaps "prepareMethod=prepexec|prepare"? (Default=prepexec) Thoughts? |
|
I'd rather take the approach of jTDS as it allows to add different strategies in the future without breaking compatibility. |
f841b78 to
0f7a423
Compare
src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/ISQLServerConnection.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerDriver.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Outdated
Show resolved
Hide resolved
src/main/java/com/microsoft/sqlserver/jdbc/SQLServerPreparedStatement.java
Show resolved
Hide resolved
src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/microsoft/sqlserver/jdbc/unit/statement/PreparedStatementTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- can we also add a test that test the property in connection string? (instead of just datasource)
- we should add this property to updateDataSource in AbstractTest as well
- we should also add tests for this property when AE is enabled
|
Should this be added to the docs at https://docs.microsoft.com/en-us/sql/connect/jdbc/improving-performance-and-reliability-with-the-jdbc-driver ? |
|
Hi @otbutz, We're adding this under Prepared statement metadata caching for the JDBC driver. The proposed changes are currently under review by the MS Docs team, but expect the docs to be updated soon. |
No description provided.