Results 1 to 2 of 2

Thread: Date problem

  1. #1

    Default Date problem

    Hi all,
    I am getting this error while inserting date.
    Code:
    [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
    2005-12-21 18:30:12,234 INFO [org.springframework.jdbc.support.SQLErrorCodesFactory] - SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
    2005-12-21 18:30:16,953 ERROR [com.home.Entry24by7Controller] - Error in 24by7  *******
    org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into ON_CALL(EMP_NO,SUPPORT_DETAILS,PRDUCT_NAME,FROM_DATE,TO_DATE,DURATION) values(?,?,?,?,?,?)]; ORA-01843: not a valid month
    ; nested exception is java.sql.SQLException: ORA-01843: not a valid month
    
    java.sql.SQLException: ORA-01843: not a valid month
    I am inserting date in format as dd/MM/yyyy.
    Regards,
    Sasikanth

  2. #2
    Join Date
    Aug 2004
    Posts
    123

    Default

    This isn't really a Spring MVC problem, or even a Spring problem, it's a JDBC one. You need to make sure your date is entered in a way understood by JDBC. "dd/MM/yyyy" is not, unless you tell it how to deal with it. Google on "JDBC date format" and you should come up with something useful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •