Results 1 to 2 of 2
  1. #1
    computerbum is offline Member
    Join Date
    Feb 2010
    Posts
    26
    Rep Power
    0

    Default convert String to date and pass to PreparedStatement

    Ok, here is my problem

    I am retrieving a date from a web page that returns a date in the format '2010-09-12' as string from a text box. What I want to do is convert it to a date and pass it in a PreparedStatement to handle it.

    How can I do this?

  2. #2
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default

    You can use SimpleDateFormat to convert it using parse() method.

Similar Threads

  1. convert String date to Date
    By computerbum in forum New To Java
    Replies: 7
    Last Post: 09-18-2010, 04:26 PM
  2. how we can convert string to date?
    By cowboy2010 in forum New To Java
    Replies: 4
    Last Post: 08-25-2010, 09:41 PM
  3. PreparedStatement - inserting date
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-11-2008, 09:44 AM
  4. PreparedStatement with java.sql.Date
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-10-2008, 12:39 PM
  5. Replies: 1
    Last Post: 08-03-2007, 11:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •