Re: ResultSet.getTimestamp() truncating trailing zeros in milliseconds
- From: "joeNOSPAM@xxxxxxx" <joe.weinstein@xxxxxxxxx>
- Date: Mon, 7 Jul 2008 20:16:54 -0700 (PDT)
On Jul 7, 10:19 am, cembry <cem...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
ResultSet.getTimestamp() seems to be truncating trailing zeros in the
milliseconds field.
I have a timestamp value in the database that shows as 2008-07-07
11:23:17.220 when I query it directly using MSSQL Management Studio. Note
that the milliseconds is 220. When I query that same column using JDBC and
then do ResultSet.getTimestamp(), it is showing the value as 2008-07-07
11:23:17.22. Note that the milliseconds is 22. This only occurs when the
milliseconds field in the database is divisible by ten and so ends with a
trailing zero. I can reproduce this 100% consistently.
This looks like a bug to me. It is causing one of my unit tests to fail. Am
I doing something wrong?
SQLServer doesn't actually support datetime values with a millisecond
accuracy,
so whatever round values to a reliable accuracy no better than what
the DBMS
supports, is better, IMHO.
Joe Weinstein
.
- Prev by Date: RE: BUG: JDBC connection disconnected, can't reconnect
- Next by Date: RE: BUG: JDBC connection disconnected, can't reconnect
- Previous by thread: RE: BUG: JDBC connection disconnected, can't reconnect
- Next by thread: Re: ResultSet.getTimestamp() truncating trailing zeros in millisec
- Index(es):
Relevant Pages
|
Loading