Re: Setter method for Date entry



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
.



Relevant Pages

  • Re: Object/Relational Mapping is the Vietnam of Computer Science
    ... SQL was a pseudo-standard middle between systems that always offered their own proprietary things as well. ... Like html and C/C++ and JavaScript and everything else out there, vendors slowly merged toward more fully supporting a standard by customer demand. ... Databases were the original home of neckties running IT. ... query language. ...
    (comp.lang.ruby)
  • Re: Newbie question - .Net Compact and ADO???
    ... System.Data.SqlServerCe to work with local SQL CE databases on the device. ... Unlike the desktop the standard providers are not built into the System.Data ... The Compact Framework also has a provider for remote SQL servers ...
    (microsoft.public.pocketpc.developer)
  • RE: Upgrading SQL 2000 Developer to Standard
    ... You cannot upgrade the Developer edition to Standard, ... restore/attach your databases. ... SQL Setup Test Team ...
    (microsoft.public.sqlserver.setup)
  • Re: SQL Anfänger
    ... Arne Schittenhelm schrieb: ... Hallo Arne, ... ich glaube Golo meinte: wenn du weißt, ... Dazu brauchst du erstmal kein SQL. ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • Re: The definition of the Standard variation of British English
    ... Whether Arne can accept both that the "standard" is at least a little ... Could I say, it is not standard English but "group" language -or should I accept it, knowing that they will fail the examination in written English when they write so? ... I would say that it depends a bit on the maturity of the students. ...
    (alt.usage.english)