Re: Setter method for Date entry
- From: Lew <noone@xxxxxxxxxxxxx>
- Date: Thu, 16 Oct 2008 22:14:08 -0400
Arne Vajhøj wrote:
Lew wrote:Arne Vajhøj wrote:Only if you can live with loosing hhmmss information stored in
the DATE field.
It does not sound very attractive to me.
This group puzzles me. On the one hand, there is a strong vocal contingent stressing the importance of being portable between databases. On the other hand, there is this advice to use the SQL DATE type in a non-portable manner.
Which is better, to use DATE as the standard calls for it to be used, holding only date information, or to take advantage of a DBMS-specific extension to hold time information in violation of the standard and portability?
Oracle is not following the standard.
Before 9i then DATE was the *only* option, because TIMESTAMP did
not exist.
If you have an existing table with DATE type, then it can very
likely contain hhmmss info.
I don't think it will be good practice to ignore that in a Java
app using that table just because the SQL standard type does not
contain hhmmss.
If you use java.sql.Timestamp, then the problem is that fractions of
seconds are lost when saving from Java to Oracle.
I consider that a much smaller problem.
If it is a new table, then it is easy just use TIMESTAMP and
no problem.
BTW a quick googling find that there are also some JDBC driver
issues to consider:
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#08_01
Portability is great. But the reality in SQL dialects is problems.
Actually, Arne, I agree with your points and tend to disagree with the notion that all database-connected apps must be database agnostic.
--
Lew
.
- References:
- Setter method for Date entry
- From: francan00
- Re: Setter method for Date entry
- From: Lew
- Re: Setter method for Date entry
- From: Arne Vajhøj
- Re: Setter method for Date entry
- From: Lew
- Re: Setter method for Date entry
- From: Arne Vajhøj
- Re: Setter method for Date entry
- From: Lew
- Re: Setter method for Date entry
- From: Arne Vajhøj
- Setter method for Date entry
- Prev by Date: Re: Java Web Start does not launch application
- Next by Date: Re: Buffering data on disk
- Previous by thread: Re: Setter method for Date entry
- Next by thread: Re: Setter method for Date entry
- Index(es):
Relevant Pages
|