db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: Derby/Oracle - single SQL query?
Date Thu, 05 Feb 2009 10:21:34 GMT
>>>>>>>>>>>> Kent Spaulding wrote (2009-02-04 12:47:15):
> Thanks Bernt.
>
> That works in both DBs.
>
> For the rest of what I've discovered:
>
> Creating a to_date function also works.  Thanks for that too, as it  
> looks like I'll need one for decode() as well.[1]

Why would you need such a function? A date column can be retrieved
from result set with rs.getDate(n) and should work correctly on both
databases. Date objects may be inserted with setDate() or as literals
with the JDBC escape syntx {d '......'}. You should then not have to
bother at all with how the different DB's have implemented this if
they deviate from the SQL standard (like Oracle).

-- 
Bernt Marius Johnsen, Staff Engineer
Database Technology Group, Sun Microsystems, Trondheim, Norway

Mime
View raw message