Re: Oracle ClassCast Exception

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Feb 16 2005 - 12:07:16 EST

  • Next message: Joćo Paulo Vasconcellos: "Re: Oracle ClassCast Exception"

    How are NUM_DEPEN and NUM_MATRICULA defined in your model?
    What data types are they?

    -Mike

    =?ISO-8859-1?Q?Jo=E3o_Paulo_Vasconcellos?= <vasconcello..mail.com> wrote:
    > On Wed, 16 Feb 2005 11:37:02 -0500, Mike Kienenberger
    > <mkienen..laska.net> wrote:
    > > Which version of the Oracle driver are you using?
    >
    > Oracle8i 8.1.7.1, from oracle site.
    >
    > > Also, provide the query being logged by Cayenne, and what you're pasting
    > > into Oracle. Maybe that will shed some light.
    >
    > Logged by cayenne:
    >
    > INFO QueryLogger: --- will run 1 query.
    > INFO QueryLogger: Opening connection: jdbc:oracle:thin..voracle:1521:DIX
    > Login: dixsp
    > Password: *******
    > INFO QueryLogger: +++ Connecting: SUCCESS.
    > INFO QueryLogger: SELECT t0.DAT_EXCLUSAO, t0.DAT_INCLUSAO,
    t0.DES_EMAIL_BENEF,
    > t0.DES_SENHA_ANTERIOR, t0.DES_SENHA_ATUAL, t0.NOM_SOLICITANTE,
    t0.NUM_DEPEN, t0.
    > NUM_DV, t0.NUM_MATRICULA FROM DIXSP.USUARIO_SENHA_WEB t0 WHERE
    (t0.NUM_DEPEN = ?
    > ) AND (t0.NUM_MATRICULA = ?) [bind: '12', '12122121'] - prepared in 78 ms.
    >
    > INFO QueryLogger: *** error.
    > java.lang.ClassCastException
    > at
    oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedSt
    > atement.java:2021)
    > at
    oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedSt
    > atement.java:2102)
    > at
    org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(Abstr
    > actType.java:78)
    > at
    org.objectstyle.cayenne.access.types.CharType.setJdbcObject(CharType.
    > java:202)
    > at
    org.objectstyle.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.jav
    > a:544)
    > at
    org.objectstyle.cayenne.access.trans.QueryAssembler.initStatement(Que
    > ryAssembler.java:164)
    >
    >
    > And what I pasted:
    >
    > SELECT t0.DAT_EXCLUSAO, t0.DAT_INCLUSAO, t0.DES_EMAIL_BENEF,
    > t0.DES_SENHA_ANTERIOR, t0.DES_SENHA_ATUAL, t0.NOM_SOLICITANTE,
    t0.NUM_DEPEN, t0.
    > NUM_DV, t0.NUM_MATRICULA FROM DIXSP.USUARIO_SENHA_WEB t0 WHERE
    > t0.NUM_DEPEN = 12 AND t0.NUM_MATRICULA = 12121212
    >
    >
    >
    > > Otherwise, your best bet is to set a breakpoint at
    > >
    org.objectstyle.cayenne.access.types.AbstractType.setJdbcObject(AbstractType.java:78)
    > > and see what jdbc type is being set as well as what field name and value
    is
    > > being referenced.
    >
    > Gonna try this now. And goona try fetching rows from some other table,
    > one that does not have DATE fields.
    >
    > Thanks,
    > --
    > Joćo Paulo Vasconcellos
    > ICQ: 123-953-864



    This archive was generated by hypermail 2.0.0 : Wed Feb 16 2005 - 12:06:33 EST