Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sybase DATETIME as both sql.DATE and sql.TIMESTAMp

390344Apr 24 2003 — edited Apr 24 2003
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2003
Added on Apr 24 2003
1 comment
651 views