Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

string to date then db insert

650829Jul 18 2008 — edited Jul 18 2008
hi.
I get date in format other than I have in db, so I made a String of ot, cutted and switched into format oracle wanted me to have: dd-mon-yyyy.

Then I switch using java.util/sql.Date my String to Date but INSERT wont work with it. If I put 'sysdate' in the data field it goes fine and saves itself in db.

When I write same insert ("insert into Date (date_b) values ('12-jun-1983')" ) from console it workes fine and adds date in the db.

Same insert wont work from application, once I switch date with 'sysdate' it works fine.

So in other words, I menage to switch my string into date format however db wont take it.
Any help will be most welcome, best regards, cmf.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2008
Added on Jul 18 2008
6 comments
775 views