Re: Oracle ClassCast Exception

From: Joćo Paulo Vasconcellos (vasconcello..mail.com)
Date: Wed Feb 16 2005 - 12:09:01 EST

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

    Very good shot, I only get problems on tables with DATE fields...

    INFO QueryLogger: +++ Connecting: SUCCESS.
    INFO QueryLogger: SELECT t0.DES_EMAIL, t0.DES_SUGESTAO, t0.NUM_SEQ_FALE_COM_DIX
    AMICO FROM DIXSP.SUGESTAO_WEB t0
    INFO QueryLogger: === returned 0 rows. - took 219 ms.
    INFO QueryLogger: +++ no commit - transaction controlled externally.
    INFO QueryLogger: --- will run 1 query.
    INFO QueryLogger: SELECT t0.DES_EMAIL, t0.DES_SUGESTAO, t0.NUM_SEQ_FALE_COM_DIX
    AMICO FROM DIXSP.SUGESTAO_WEB t0
    INFO QueryLogger: === returned 0 rows. - took 16 ms.
    INFO QueryLogger: +++ no commit - transaction controlled externally.

    All went fine.

    Correct me if I am wrong, a quickfix would be to change the default types in

    org.objectstyle.cayenne.dba.types.xml

    from DATE to TIMESTAMP, correct?

    Many Thanks for the quick help.

    On Wed, 16 Feb 2005 13:48:44 -0300, Joćo 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
    >

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



    This archive was generated by hypermail 2.0.0 : Wed Feb 16 2005 - 12:09:02 EST