[Solved] java.sql.SQLException - Zero date value prohibited

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!

4 Comments

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.

  1. Saved my day bro~
    Thanks!

    ReplyDelete
  2. https://topic.alibabacloud.com/a/javasqlsqlexceptionzero-date-value-prohibited-exception-handling_1_27_30012188.html

    ReplyDelete
Post a Comment
Previous Post Next Post