Re: java.sql.SQLException: JZ0TE: Attempted conversion between an illegal pair of types.

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Oct 22 2003 - 13:04:16 EDT

  • Next message: Andrus Adamchik: "Re: java.sql.SQLException: JZ0TE: Attempted conversion between an illegal pair of types."

    Hi Axel,

    I just created a unit test in Cayenne to reproduce your condition. And
    I got the same exact error:

    > java.sql.SQLException: JZ0TE: Attempted conversion between an illegal
    > pair
    > of types. Valid database
    > datatypes are: 'Double, Float, BigDecimal, Boolean, Integer, Long,
    > byte[],

    It looks like Sybase JDBC driver does not support java.lang.Short
    binding in PreparedStatements at all :-(

    Changing the Java type to java.lang.Integer (while still keeping the
    column type as "smallint") fixed the problem for me. For a regular
    attribute I would have recommended to remap "java.lang.Short" to
    "java.lang.Integer". But since we are dealing with PK column, Cayenne
    has to address this Sybase driver bug internally. I will post the fix a
    bit later.... Stay tuned.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Oct 22 2003 - 13:04:16 EDT