Skip to Main Content

Java Database Connectivity (JDBC)

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!

Inserting dates in mm/dd/yyyy format in excel sheet

843859Aug 21 2008 — edited Oct 22 2008
I am reading data from sql server 2005 which returns dates in the yyyy/mm/dd format. Now I have to insert this data into an excel sheet and it is supposed to be in the mm/dd/yyyy format. I tried converting the date formats in java but when I insert the date as a String the program throws
java.sql.SQLException: [Microsoft][ODBC Excel Driver] Data type mismatch in criteria expression.

If I try to insert it as a java.util.Date or java.sql.Date it also includes the timestamp(which i do not want ) since thats the way MS SQL Server returns it in the result set.
Someone said using PreparedStatement would help. How?
Can someone please help me ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2008
Added on Aug 21 2008
16 comments
701 views