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'd prefer to use a PreparedStatement and its setDate method. That's guaranteed to work in all database servers with a JDBC driver:
Alternatively, in MS SQL Server you can use strings to specify the date. You don't want to use "01-05-2012" as the value though, as the server's region determines whether that's January 5th or May 1st. What always works is to use yyyy-MM-dd: "2012-01-05".