Problem Value '0000-00-00' can not be represe

Developers
Frank
2007-07-02
2013-04-23
  • Frank
    Frank
    2007-07-02

    Hi,

    I have install Mecca but in some options like study session, intake and pre-registration I get the message "Value '0000-00-00' can not be represented as java.sql.Date", could you help me solve this?

    Thanks in advance,

    Frank.

     
    • Redhuan D. Oon
      Redhuan D. Oon
      2007-07-02

      Dont remember encountering that. May be a non value as its 00s. Can u give more info? Did u use the mecca.db sql to build your db?

      Maybe complete steps u taken from scratch can introduce your whole setup. Better still if u re a developer and can load up the source of Mecca2 from CVS. Then i can assist from there. U can even help to update fixes once i am clear where we are and coach u from there.

      red1

       
    • Hello Frank,

      The error happened because of the null values in the date field.  This happened in the latest version of mysql jdbc connector, where it will throw an exception whenever it found a field of type date (or datetime) contains null (in mysql null date field is represented by 0000-00-00).  What you can do is, fill in the date field with some date values using the UPDATE statement.  You can do this with any mysql client.

      For example,

      UPDATE table <table_name> SET <date_field> = '2007-01-01' where date_field is null

      Thanks

       
    • Wizzard
      Wizzard
      2007-07-30

      Hi I was wondering if anyone had found a solution to this problem.  I tried to change all of the date values but it did not work, I also tried changing the jdbc driver but that didnt work either.  I took a look at the exception call stack and seems to come from the session data but all of the sessions in the database have a valid start and end date so I'm stuck.  Here is the call stack, a little bit of it anyways.  One last thing.  Can someone please point me in the right direction on how to make this project work from a developer's stand point (the development environment, Apache, Tomcat, how do yo make it compile, what do you copy after it compiles and where, etc) I have combed the forums up and down trying to find a guide but have not found one.  Please at least point me to what i need to read.  I installed eclipse, downloaded University from svn but now do not know what to do.  Thanks a bunch

      at java.lang.Thread.run(Thread.java:534)
      java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Dat
      e
              at com.mysql.jdbc.ResultSet.getDateFromString(ResultSet.java:5620)
              at com.mysql.jdbc.ResultSet.getDate(ResultSet.java:978)
              at com.mysql.jdbc.ResultSet.getDate(ResultSet.java:935)
              at com.mysql.jdbc.ResultSet.getDate(ResultSet.java:949)
              at mecca.sis.registration.SessionData.getList(SessionData.java:133)
              at mecca.sis.registration.SessionData.getListDesc(SessionData.java:63)
              at mecca.sis.registration.TermActivationModule.doTemplate(TermActivation
      Module.java:49)

       
    • Redhuan D. Oon
      Redhuan D. Oon
      2007-07-30

      If u want to play with the source, then checkout the latest via CVS/Ajaxlook project. Use the sample sqls within the database folder. Edit the /properties/dbconnection.properties and put a copy into the /classes/ folder.

      Later i will send the latest DB that can work without any data error.