Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

how to insert date in sqlserver in (yyyy-MM-dd HH:mm:ss) format

843838Mar 30 2007 — edited Feb 27 2008
please help how to insert date in sqlserver in (yyyy-MM-dd HH:mm:ss) format, I have tried java.sql.Date but in that case the time portion automatically changed to 00:00:00 and while using java.sql.Timestamp it through me an error as data type mismatch in data base.
I have set data type as datetime in sqlserver instead of timestamp the reason is I have two datetime column in my table and if I use timestamp it will not allow to columns................

thanks in advance
Amit
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2008
Added on Mar 30 2007
10 comments
1,701 views