Skip to content
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

JdbcTemplate cannot set null parameter with Oracle driver [SPR-10385] #15018

Closed
spring-issuemaster opened this issue Mar 15, 2013 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Mar 15, 2013

Tom Witmer opened SPR-10385 and commented

The StatementCreatorUtils.setNull(..) method fails with an Oracle database.

The method expects the driver to throw an exception when ps.getParameterMetaData() is invoked (line 234), but this actually succeeds and returns a value.

Later in the method (line 241), when pmd.getParameterType() is invoked, Oracle throws an "Unsupported Feature" exception.

I think the easiest fix here would be to move the getParameterType() invocation into the existing try block so both conditions are accounted for.

Stack trace attached.


Affects: 3.2.2

Attachments:

Issue Links:

  • #14818 Update to spring 3.1.3 causes SqlException when executing sql statement with null parameters, caused by changes in StatementCreatorUtils.setNull method.
  • #15726 performancedrop due to repeated JDBC 3.0 getParameterType calls in setNull in StatementCreatorUtils
  • #19196 Protect against getParameterType cursor leak with Oracle 12c JDBC driver

Referenced from: commits 6b4c29c

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 15, 2013

Tom Witmer commented

Source file attached, in case the line numbers don't match up to trunk source.

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 15, 2013

Tom Witmer commented

Attached source file that should resolve the issue.

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Mar 15, 2013

Tom Witmer commented

I just confirmed via the debugger that the proposed fix (attachment) would resolve the problem I'm seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.