Posted by Editor | 9/18/2016 06:02:00 pm | 0 comments »
Recently while working on a Java + Spring + Hibernate + MySQL project I encountered a weird exception "java.sql.SQLException: Zero date value prohibited"!


As usual I did a quick search on Google but to my surprise Google did not return any result!

First I was scared, thought troubleshooting would be difficult. Upon closed analysis of the issue, this came out to be a silly data issue!


org.springframework.dao.TransientDataAccessResourceException: Hibernate operation: could not execute query; SQL [select field1, field2, field3 from table1]; Zero date value prohibited; nested exception is java.sql.SQLException: Zero date value prohibited.

I had a date column where the entries were '0000-00-00', just nullified the entries and the error went away!


Tags: | | |

No comments:

Post a Comment

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to our feed and get articles like this delivered automatically to your feed reader? Like our Facebook Page.




Recommended products