AW: Problem with Date/Time-part

From: René Kulschewski (KU..vu.de)
Date: Thu Feb 24 2005 - 12:19:43 EST

  • Next message: Andrus Adamchik: "Re: AW: Problem with Date/Time-part"

    I get the following error:

    24.12 18:12:59,360|[ShutdownHook]|INFO |access.QueryLogger | -
    select id, comdeviceevnmeth_id, isacknowledge, comdevice_id, txdatetime,
    rxdatetime, gpstime, gpslongitude, gpslatitude, directionofmotion, velocity,
    locationangle, locationdescription, locationdistance, t.indata.getclobval()
    indata, creation, creationby, modification, modificationby, isdeleted,
    comdeviceevnstate_id, tour_id from comdeviceevent t where
    t.comdeviceevnstate_id=1 order by t.comdevice_id,t.txdatetime,t.gpstime
    24.12 18:12:59,420|[ShutdownHook]|INFO |access.QueryLogger | - ***
    error.
    java.sql.SQLException: Ungültiger Spaltentyp
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
            at
    oracle.jdbc.driver.OracleStatement.getTimestampValue(OracleStatement.java:498
    2)
            at
    oracle.jdbc.driver.OracleResultSetImpl.getTimestamp(OracleResultSetImpl.java:
    689)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at
    org.objectstyle.cayenne.access.types.DefaultType.materializeObject(DefaultTyp
    e.java:243)
            at
    org.objectstyle.cayenne.access.DefaultResultIterator.readDataRow(DefaultResul
    tIterator.java:250)
            at
    org.objectstyle.cayenne.access.DefaultResultIterator.nextDataRow(DefaultResul
    tIterator.java:194)
            at
    org.objectstyle.cayenne.access.DefaultResultIterator.dataRows(DefaultResultIt
    erator.java:224)
            at
    org.objectstyle.cayenne.access.jdbc.SQLTemplateSelectExecutionPlan.execute(SQ
    LTemplateSelectExecutionPlan.java:149)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:342)
            at
    org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java:654)
            at
    org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:14
    08)
            at
    org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.java:17
    9)
            at
    org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:13
    66)
            at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1622
    )
            at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:1485
    )
            at
    de.ivu.combitour.dao.ComdeviceeventDAO.findUnprocessed(ComdeviceeventDAO.java
    :84)
            at
    de.ivu.combitour.telematik.CdepController.processEvents(CdepController.java:1
    11)
            at de.ivu.combitour.telematik.Cdep.ProcessIdle(Cdep.java:75)
            at de.ivu.combitour.ShutdownHook$1.run(ShutdownHook.java:25)

    Thats the statement:

    String sqlStr = "select id, comdeviceevnmeth_id, isacknowledge, comdevice_id,
    "
                                    + "#result('txdatetime'
    'java.sql.Timestamp'), "
                                    + "#result('rxdatetime'
    'java.sql.Timestamp'), "
                                    + "#result('gpstime' 'java.sql.Timestamp'),"
                                    + " gpslongitude, gpslatitude, "
                                    + "directionofmotion, velocity,
    locationangle, locationdescription, "
                                    + "locationdistance, t.indata.getclobval()
    indata, "
                                    + "#result('creation' 'java.sql.Timestamp'),
    "
                                    + "creationby, "
                                    + "#result('modification'
    'java.sql.Timestamp'), "
                                    + "modificationby, isdeleted, "
                                    + "comdeviceevnstate_id, tour_id "
                                    + "from comdeviceevent t where
    t.comdeviceevnstate_id=1"
                                    + " order by
    t.comdevice_id,t.txdatetime,t.gpstime";

    Regards
    René

    > -----Ursprüngliche Nachricht-----
    > Von: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Gesendet: Donnerstag, 24. Februar 2005 17:58
    > An: cayenne-use..bjectstyle.org
    > Betreff: Re: Problem with Date/Time-part
    >
    > Maybe it doesn't, but Oracle driver is a strange beast. Could
    > you try using SQLTemplate with a "#result" directive
    > (http://objectstyle.org/cayenne/userguide/fetch/sqltemplate-sc
    > ripting.html).
    > In your sqlString variable replace all date columns with
    > scriplets like this one:
    >
    > #result('creation' 'java.sql.Timestamp')
    >
    > Does it change anything?
    >
    > Andrus
    >
    >
    > > Hi,
    > >
    > > This is a sample. But the access method doesnt matter IMHO,
    > even if i
    > > access a object by ObjA.getToObjB() it is the same behaviour.
    > >
    > > -->
    > > public List findUnprocessed() {
    > >
    > > String sqlStr = "select id,
    > comdeviceevnmeth_id, isacknowledge,
    > > comdevice_id, "
    > > + "txdatetime, rxdatetime,
    > gpstime, gpslongitude, gpslatitude, "
    > > + "directionofmotion, velocity,
    > > locationangle, locationdescription, "
    > > + "locationdistance,
    > t.indata.getclobval() indata, creation, "
    > > + "creationby, modification,
    > modificationby, isdeleted, "
    > > + "comdeviceevnstate_id, tour_id "
    > > + "from comdeviceevent t where
    > > t.comdeviceevnstate_id=1"
    > > + " order by
    > > t.comdevice_id,t.txdatetime,t.gpstime";
    > >
    > > List retval = null;
    > >
    > > DataContext ctx
    > _SingletonDataContext.getInstance().getCtx();
    > >
    > > SQLTemplate rsCde = new
    > SQLTemplate(Comdeviceevent.class, sqlStr,
    > > true);
    > >
    > > retval = ctx.performQuery(rsCde);
    > >
    > > return retval;
    > > }
    > >
    > > <--
    > >
    > >
    > >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Feb 24 2005 - 12:19:51 EST