View Single Post
  #3  
Old October 14, 2005, 01:55 PM
Mahmood's Avatar
Mahmood Mahmood is offline
Administrator
Operations & Administrations
 
Join Date: June 20, 2002
Location: Montreal, Canada
Favorite Player: Mashrafe Mortaza
Posts: 7,825

The oracle date is dd-mmm-yyyy format.

You are trying to insert a date objects toString value. To do that.. use this instead

INSERT INTO BUNDLE
(ESELLINGID,CREATE_DATE,CREATE_BY,LST_UPD_DATE,LST _UPD_USR,EN,FR_CA,AR)
VALUES
('eselling.test1',
to_date(replace('Fri Oct 14 12:10:05 EDT 2005','EDT'),'Dy Mon dd hh24:mi s yyyy'),
.............

Or do it the right way....

java.util.Date dt = new java.util.Date();
java.text.DateFormat format = new java.text.SimpleDateFormat( "dd-MMM-yyyy" );
String myDate = format.format(dt);

myDate is now the string 14-OCT-2005
Now use this myDate to insert in your query...to insert, list this value as..

INSERT INTO BUNDLE
(ESELLINGID,CREATE_DATE,CREATE_BY,LST_UPD_DATE,LST _UPD_USR,EN,FR_CA,AR)
VALUES
('eselling.test1',
TO_DATYE('14-OCT-2005', 'dd-mon-yyyy'),
.............
Reply With Quote