This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am trying to take a date and put it into MySQL. I know there are a lot of ways to do this, but I am trying to use Simple Date Format "MM-DD-YYYY". I know how to parse a string and produce a date, but how would I take a date and parse it to a string in the MM-DD-YYYY format?
I've read about toPattern() and applyPattern() . Would either of these be helpful?
Why would you want to convert a Date to a String? If you use a PreparedStatement then you can use the setDate method to work with the Date object directly. No need for any string operations - let JDBC do the work for you.
Joined: Sep 03, 2009
Because I haven't gotten to "PreparedStatements" on the JavaTrail!