db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Date formatting with Network Server
Date Mon, 17 Jan 2005 14:09:11 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Army wrote:

> Question regarding date formatting in the Network Server:
>
>     System.out.println(java.sql.Date.valueOf("0001-01-01"));
>
> With a Sun JVM, the above line will print "0001-01-01".  With an IBM
> JVM, it will print "1-01-01".  The difference is apparently in the
> implementation of the "toString()" method for the two JVMs.
>
> Currently, when a query against Network Server returns a date column,
> the string value for that column is returned using the following line
> (in DRDAConnThread.java):
>
>     writer.writeString(((java.sql.Date) val).toString());
>

Maybe the network server should fetch SQL DATES from the engine using
getString() and not getDate(). I think the formatting will be consistent
in that case. This should also be more efficient because there will be
less object creation.

Replaces

   <SQL DATA internal> ->>> java.sql.Data ->>> java.lang.String

with

   <SQL DATA internal> ->>> java.lang.String


Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFB68cHIv0S4qsbfuQRAl8xAJ9g2Gng0bRAKcqXSle/5OTui/Ht/ACeMw1+
Te6WMdbmFSgmE+lBZtVa0kA=
=kIa6
-----END PGP SIGNATURE-----


Mime
View raw message