Sybase DATETIME as both sql.DATE and sql.TIMESTAMp
390344Apr 24 2003 — edited Apr 24 2003Hi,
I've noticed that other people have had a similar problem to mine but not exactly.
I'm running TopLink 9.0.3 on Solaris 8 with Sybase and JConnect5.5
I have 2 tables that have DATETIME fields in them.
I used MW to automatically create descriptors for each one of them.
Problem is for one table TopLink decided to use java.sql.Date and for the other java.sql.Timestamp.
For the class that uses the Date type the DATETIME in the DB becomes 20030423 00:00:00.000. (this is the similarity to other peoples problem)
Q1: How come TopLink can't decide to use the same type on both occasions?!?! (i.e. either Date or Timestamp)
Q2: Why doesn't it always use Timestamp for a DATETIME? The Java doc states clearly that sql.Date "normalizes" the hours, minutes, seconds and milliseconds part to zero! (Anyone know why that is?!?)
From Java doc for sql.Date:
...To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated.
Best regards,
Andrei Lenkei