db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Using datetime math with derby
Date Tue, 11 Jan 2005 19:55:52 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ulrich Voigt wrote:

> Hi,
>
> thanks for your answers. Rajesh answer hit the point.
> Dan, the link you gave didn't show a way, how to convert a TIMESTAMP to
> BIGINT.

No the link didn't, but my example SQL function with Java method did.
See below. The link was to help understand what the value of the BIGINT
returned by this function means.

Dan.


>
> SQL
>
> create function toTS(TS TIMESTAMP) returns BIGINT
> PARAMETER STYLE JAVA NO SQL LANGUAGE JAVA
> EXTERNAL NAME 'TestTS.getSimpleTime'
>
> Java
>
> public static long getSimpleTime(java.sql.Timestamp ts) {
>        return ts.getTime();
>   }

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

iD8DBQFB5C8dIv0S4qsbfuQRAsDcAKCLxbhJoYQyIQOT0xhYMd3qtMLsiwCg5W+z
S0mQjK+EvAjkWkNQyAcksjk=
=dcKN
-----END PGP SIGNATURE-----


Mime
View raw message