The default input/output date format picture used in Oracle is DD-MON-YY.
(eg.  16-MAY-2001). "2001-05-16 10:10:10" doesn't look like DD-MON-YY so
Oracle throws the statement out.

You could reformat your date-string to use the default picture, or
change the format Oracle expects to receive date strings.
The DD-MON-YY default can either be changed server wide, or on a per-client
session basis (read-up about NLS_DATE/NLS_DATE_FORMAT).  You most likely
want the latter.


On Wed, May 16, 2001 at 10:42:28PM +0800, Albert Yip wrote:
> Hi all,
>
> Just wondering about how should I deal with dates when trying to insert data
> into db with prepared statements. I tried to use strings like "2001-05-16
> 10:10:10" but it keeps giving me error:
>
> java.sql.SQLException: ORA-01861: literal does not match format string
>
> any ideas? I would really appreciate it if someone can give a hand.
>
> Thanks,
> Albert
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
Keith Wall.

http://www.beenz.com/
beenz.com (uk), 131-151, Gt. Titchfield St, London.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to