Oracle ClassCast Exception

From: Joćo Paulo Vasconcellos (vasconcello..mail.com)
Date: Wed Feb 16 2005 - 11:00:20 EST

  • Next message: Joćo Paulo Vasconcellos: "Re: Wicket and Tapestry was: [Cayenne vs. EOF...]"

    Hi list,

    I am having a problem trying to retrtieve some rows from an Oracle 8i
    database. I am using Cayenne 1.1 final and DB adapter
    'org.objectstyle.cayenne.dba.oracle.OracleAdapter' and jdbc driver
    'oracle.jdbc.driver.OracleDriver'.

    I need to get a row from 2 key columns, trtying to do like that:

    Map parameters = new HashMap();
    parameters.put("NUM_MATRICULA", id1);
    parameters.put("NUM_DEPEN", id2);
            
    UsuarioSenhaWeb usw =
        (UsuarioSenhaWeb) DataObjectUtils.objectForPK(context,
    UsuarioSenhaWeb.class, parameters);

    The final query generated by cayenne is correct and return as expected
    if I copy/paste to oracle, but when I try to do in my application, it
    gives me stack trace:

    INFO QueryLogger: *** error.
    java.lang.ClassCastException
            at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2021)
            at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2102)
            at org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(AbstractType.java:78)

    Anyone has any ideas? I think the Oracle driver is kicking my ass, but
    not sure. Got the last one from Oracle and still got the problem.

    Thanks,

    -- 
    Joćo Paulo Vasconcellos
    ICQ: 123-953-864
    



    This archive was generated by hypermail 2.0.0 : Wed Feb 16 2005 - 11:00:23 EST