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: subramanian Athimoolam <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 10, 2000 6:41 AM
Subject: Re: java.sql.Date problem
> hi
> data inserting time give the following formate
>
> java.util.Date date = new java.util.Date();
> java.text.DateFormat dateFormat = new
> java.text.SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
> String formattedDate = dateFormat.format(date);
>
>
> INSERT INTO msgdf
> VALUES("+tid1+",'"+Value+"','"+Name+"',"+k+",'"+u+"',TO_DATE('"
> +formattedDate + "','DD-MM-YY
> HH24:MI:SS'),'"+Top+"',"+co+",'"+"A"+"',TO_DATE('" +formattedDate+
> "','DD-MM-YY HH24:MI:SS'),
>
>
> then you will retirve the formate[ see my previous mail]
>
>
> subu
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>
===========================================================================
> 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".