Hi Albert,
    java.sql.Date has only Date component (this is different from
java.util.Date), here you have to use java.sql.Timestamp to store date with
time.

use this code
java.util.Date today = new java.util.Date();
java.sql.Timestamp sqlToday = new java.sql.Timestamp(today.getTime());


Dharani.



----- Original Message -----
From: Albert <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 10, 2000 5:40 AM
Subject: java.sql.Date problem


> Hi,
>
>     I've written a servlet which call an entity bean create with a
parameter
> in java.sql.Date type.  The record successfully created in the Oracle8i
> database, but the time portion of it lost.  How can I preserve the time
> portion??
>
>     My code to handle the Date variable in servlet :-
>       java.util.Date today = new java.util.Date();
>       sqlToday = new java.sql.Date(today.getTime());
>
> Albert
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to