SAP Knowledge Base Article - Preview

3577433 - Add support for JDBC 4.2 standard java.time.LocalDate and java.sql.Date - SDK for SAP ASE

Symptom

  • JDBC 4.2 standard drivers should have internal conversion between java.time.LocalDate and java.sql.Date.
  • Stack1
    java.sql.SQLException: JZ0TC: Attempted conversion between an illegal pair of types.
            at com.sybase.jdbc42.jdbc.ErrorMessage.raiseError(ErrorMessage.java:857)
            at com.sybase.jdbc42.jdbc.SybResultSet.convertObjectToJavaType(SybResultSet.java:3669)
            at com.sybase.jdbc42.jdbc.SybResultSet.getObject(SybResultSet.java:3632)
            at Test.main(Test.java:24)
    Caused by: java.sql.SQLException: java.lang.ClassCastException: Cannot cast java.sql.Date to java.time.LocalDate
            ... 3 more
    Caused by: java.lang.ClassCastException: Cannot cast java.sql.Date to java.time.LocalDate
            at java.base/java.lang.Class.cast(Class.java:3605)
            at com.sybase.jdbc42.jdbc.SybResultSet.convertObjectToJavaType(SybResultSet.java:3665)
            ... 2 more
  • Stack2
    com.sybase.jdbc42.jdbc.SybSQLException: Class java.time.ZonedDateTime not found. Check and make sure that the class has been installed, and an entry exists in Sysxtypes.


Read more...

Environment

  • SAP Adaptive Server Enterprise (ASE) Software Developer Kit (SDK) 16.0
  • jConnect
    • JDBC 16 ( is version JDBC 7.07 )
  • jconn42.jar
  • java

Product

SAP Adaptive Server Enterprise 16.0 ; SAP Adaptive Server Enterprise 16.0.4 ; SAP Adaptive Server Enterprise SDK 16.0

Keywords

KBA , BC-SYB-SDK , SDK , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.