News and Articles on Technology, Finance and Marketing

[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!
Share:

4 comments:

  1. Saved my day bro~
    Thanks!

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

    ReplyDelete

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.

About Us

About Us
We provide you the latest news on technology, finance and entertainment across the globe. Fell free to contact us for any questions or concerns.

Popular Posts

Blog Archive

Recent Posts

Definition List

Definition list
Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet
Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Unordered List

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.
  • Vestibulum auctor dapibus neque.

Pages

Theme Support

Need our help to upload or customize this blogger template? Contact me with details about the theme customization you need.