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

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Oct 22 2003 - 14:01:28 EDT

  • Next message: Michael Gentry: "Re: Does Cayenne handle binary primary keys (Sybase) in relationships?"

    Ok, here is a link to the patched version (derived from 1.0.1). This
    fix will also be included in 1.0.2.

           
    http://objectstyle.org/downloads/cayenne/patched/cayenne-src-
    1.0.1p2.tar.gz

    Andrus

    On Wednesday, October 22, 2003, at 01:04 PM, Andrus Adamchik wrote:

    > 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 - 14:01:26 EDT