Skip to Main Content

New to Java

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!

Convert a string to date, so that i can insert it on SQL database

801477Oct 2 2008 — edited Oct 2 2008
Hi, me again..

i have this variable
date.getText()

i want to convert it to date, so i did this:

d = (Date) DateFormat.parse(date.getText());

but it says "Cannot make a static reference to the non-static method parse(String) from the type DateFormat"

what the hell is that?
: \
can someone help? i want the date to correspond to the variable format on my database (DATETIME (yyyy-mm-dd))
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2008
Added on Oct 2 2008
8 comments
686 views