Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQl Server error converting datetime to smalldatetime

 
Vijay Bala
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using a SQL Server stored proc.I am trying to update a smalldatetime column and get the error "error converting datetime to smalldatetime". Another smalldatetime column in the table has the format "yyyy-mm-dd hh:mm:ss".
I tried the foll code:
long i = drvo.getDateOfBirth().getTime();//getDateOfBirth returns a java.util.Date
call.setDate(1,new java.sql.Date(i));
//call.setTimestamp(1,new java.sql.Timestamp(i));
Using both the setDate and setTimestamp gave me the same error.I am using the sql server type 4 driver for 7.0.I tried using Resultsetmetadata and got the column type to be Timestamp from the table.Its defined as smalldatetime in the table.
Thanx in advance for any help,
Vijay
 
sahana sah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got the same problem. Any one to help??
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sahana2007",
Please check your private messages for a message from me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic