wood burning stoves 2.0
The moose likes Oracle/OAS and the fly likes How to insert date in below format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Reply locked New topic

How to insert date in below format

Kartik Talasu
Ranch Hand

Joined: Aug 21, 2009
Posts: 98
Hi in my oracle database am having a column of type "DATE".

And I want to insert date in the format of "19/Apr/2010 17:46:57" using java. While am inserting in this format its giving an exception of "date format picture ends before converting entire input string".

How to insert in this format?

Sona Patel
Ranch Hand

Joined: Mar 30, 2009
Posts: 75
Hi Kartik,

I am not sure but you can try following syntax in your insert statement. I am considering that you are executing insert statement from java class.

To_DATE(TO_CHAR('Your_Date','dd/Mon/yyyy HH24:MI:SS'))

Hope this helps.

Jan Cumps

Joined: Dec 20, 2006
Posts: 2541

Duplicate of http://www.coderanch.com/t/492038/JDBC/java/Not-able-convert-string-date
Please Carefully Choose One Forum.

OCUP UML fundamental and ITIL foundation
I agree. Here's the link: http://aspose.com/file-tools
subject: How to insert date in below format
It's not a secret anymore!