Subject | Re: [Firebird-Java] Timestamp Linux |
---|---|
Author | Mark Rotteveel |
Post date | 2018-03-24T08:28:59Z |
On 24-3-2018 07:08, hugo.larson@... [Firebird-Java] wrote:
behavior between Windows
Some questions:
1. Is the database server the same? Or: is the OS difference only
client, only Firebird server or both client and Firebird server?
2. If not, is the DDL of both the same?
3. Are the Java version, Firebird version and Jaybird version the same?
4. How do you insert the value, specifically how is the timestamp
generated (created in Java, hardcoded expression like 'now' or
CURRENT_TIMESTAMP), default column, trigger)?
5. How do you select the value?
6. What happens if you use CURRENT_TIMESTAMP or CURRENT_TIMESTAMP(3);
try both when inserting, and - separately - when selecting, that is, on
insert replace the value with hard code CURRENT_TIMESTAMP or
CURRENT_TIMESTAMP(3), or on select replace the column with the hardcoded
value (don't forget to add an alias with the original column name).
7. How do you verify the millisecond part is not stored; did you check
the millisecond part before storing?
Be aware though that java.sql.Timestamp is special: it stores seconds
precision in the field that in a normal java.util.Date has milliseconds
precision, and it has a separate field for nanosecond precision. So
depending on the method of introspection, you might get the wrong
impression.
Mark
--
Mark Rotteveel
> I'm using FB 2.5, JayBird 3 on Linux Ubuntu.I can't come up with a path where Jaybird would exhibit different
>
> When storing Timestamp the millisecond part is stored as 000.
> This is not the case on Windows where the actual ms is stored correctly.
>
> Maybe this is not related to Jaybird...
behavior between Windows
Some questions:
1. Is the database server the same? Or: is the OS difference only
client, only Firebird server or both client and Firebird server?
2. If not, is the DDL of both the same?
3. Are the Java version, Firebird version and Jaybird version the same?
4. How do you insert the value, specifically how is the timestamp
generated (created in Java, hardcoded expression like 'now' or
CURRENT_TIMESTAMP), default column, trigger)?
5. How do you select the value?
6. What happens if you use CURRENT_TIMESTAMP or CURRENT_TIMESTAMP(3);
try both when inserting, and - separately - when selecting, that is, on
insert replace the value with hard code CURRENT_TIMESTAMP or
CURRENT_TIMESTAMP(3), or on select replace the column with the hardcoded
value (don't forget to add an alias with the original column name).
7. How do you verify the millisecond part is not stored; did you check
the millisecond part before storing?
Be aware though that java.sql.Timestamp is special: it stores seconds
precision in the field that in a normal java.util.Date has milliseconds
precision, and it has a separate field for nanosecond precision. So
depending on the method of introspection, you might get the wrong
impression.
Mark
--
Mark Rotteveel