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
[FEATURE REQUEST] Support getting java.time objects from CallableStatement #1392
Labels
Enhancement
An enhancement to the driver. Lower priority than bugs.
Projects
Comments
CasualSuperman
added
the
Enhancement
An enhancement to the driver. Lower priority than bugs.
label
Jul 27, 2020
Thanks for the suggestion. I think this change makes sense and the team will soon look into supporting this type with getObject in SQLServerCallableStatement, and also possibly remove code duplication. |
CasualSuperman
added a commit
to CasualSuperman/mssql-jdbc
that referenced
this issue
Jul 28, 2020
This PR adds support for the requested functionality in microsoft#1392, but does not address the mentioned code duplication. The added library code was copied verbatim from SQLServerResultSet.
CasualSuperman
added a commit
to CasualSuperman/mssql-jdbc
that referenced
this issue
Jul 28, 2020
This PR adds support for the requested functionality in microsoft#1392, but does not address the mentioned code duplication. The added library code was copied verbatim from SQLServerResultSet.
CasualSuperman
added a commit
to CasualSuperman/mssql-jdbc
that referenced
this issue
Jul 28, 2020
This PR adds support for the requested functionality in microsoft#1392, but does not address the mentioned code duplication. The added library code was copied verbatim from SQLServerResultSet.
CasualSuperman
added a commit
to CasualSuperman/mssql-jdbc
that referenced
this issue
Jul 28, 2020
This PR adds support for the requested functionality in microsoft#1392, but does not address the mentioned code duplication. The added library code was copied verbatim from SQLServerResultSet.
CasualSuperman
added a commit
to CasualSuperman/mssql-jdbc
that referenced
this issue
Aug 13, 2020
This PR adds support for the requested functionality in microsoft#1392, but does not address the mentioned code duplication. The added library code was copied verbatim from SQLServerResultSet.
#1393 merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
I use Java 8 time types throughout my code, and would like to avoid using legacy types. This works when using a ResultSet, since it has been updated to support LocalDateTime, etc. (#744), but CallableStatement lacks support for these types.
Describe the preferred solution
I would like to be able to call
CallableStatement::getObject(1, LocalDateTime.class)
and receive and object, rather than an exception.Describe alternatives you've considered
I could get a
java.sql.Timestamp
and use.toLocalDateTime()
, but this comes with a performance penalty (#1070), and introduces legacy types into my code.Additional context
This would require more up-front work, but the code in
SQLServerResultSet::getObject(int, Class)
is almost identical toSQLServerCallableStatement::getObject(int, Class)
, and seems eligible for abstraction so that the same types are maintained between CallableStatements and ResultSets, and code duplication is removed. I recognize this difficult (I tried it briefly) sinceResultSet
andCallableStatement
share many methods, but they are not specified by the same interface.Reference Implementation
SQLServerResultSet
The text was updated successfully, but these errors were encountered: