Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while converting datatime to timestamp

 
Shantanu Deshmukh
Greenhorn
Posts: 23
Java jQuery PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am writing a simple jdbc program, which will print data column in my table. I use this statement users.getString('update_time')
The field in my database contains, for e.g, this value 2010-01-12 20:54:35.0.
The program prints this value, but also throws exception as Cannot convert value '0000-00-00 00:00:00' from column 7 to TIMESTAMP.

Please help !!
 
Shantanu Deshmukh
Greenhorn
Posts: 23
Java jQuery PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks, got a solution for that.
zeroDateTimeBehavior=convertToNull add this as a parameter in JDBC connection url to slove this problem

Hope this helps to whoever reaching to this problem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic