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] Ability to explicitly specify conversion to datetime or datetime2 #1590
Comments
This was talked about in #443, but since the feature request was buried within the comments and a little different than the original problem, I thought a proper feature request made sense. |
hi @dswitzer Thanks for creating this feature request, I have filed this into our backlog it will be considered and prioritized along with other features when we plan for the next semester. |
Thanks for the update. Let me know if there's anything I can do to assist you with the request. NOTE — I'd be content with just being able to specify |
I have just created a pull request which adds this feature. Once I got into the code, I realized there's no way to support something like the What the pull request does is implement a This is something sorely missing from the JDBC driver when supporting older databases. There are many times an organization may be running a legacy database, but want to run the database in SQL Server 2016 compatibility mode to take advantage of the query optimizations. Today there's no way to that. This feature would allow support for databases using only |
thanks a lot, we will review it and respond here. |
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
We have an application that uses SQL Server 2019 and the current schema uses
datetime
datatype for tracking timestamps. Since the database compatibility level is set to 2019, the JDBC driver is converting all timestamps intodatetime2
datatypes which is causing a number of bugs in our application.We are currently using a third party JDBC driver (Progress® DataDirect Connect® Series for JDBC™) which offers a
DateTimeInputParameterType
connection string which you can use on newer databases to have it declare parameters asdatetime
instead ofdatetimeoffset
. However, we are soon planning on moving our application stack and want to use the Microsoft SQL Server Driver as it is officially support in the new application server we plan on using.I would like to see a similar connection string added to the JDBC driver which would allow you to specify how the JDBC driver handlers timestamps without having to lower the compatibility level of the database.
Describe the preferred solution
Add a new connection string (e.g.
timestampEncoding
) which can be used to determine how timestamp should be encoded. For example, you might have the following options:See #443 (comment)
Describe alternatives you've considered
Alternatives we've considered:
datetime2
. We will probably eventually do this, but in a large multi-tenant application stack this is going to take a lot of work. We have a lot of functionality driven by timestamps, so this refactoring will take time.datetime
. Timely to implement and would require another round of refactoring when we final do migrate todatetime2
values.Additional context
none
Reference Documentations/Specifications
n/a
The text was updated successfully, but these errors were encountered: