Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-11-12T10:30:02Z by c_binding
c_binding
c_binding
12 Posts
ACCEPTED ANSWER

Pinned topic Informix irregular time-series read-out withJava

‏2013-11-12T08:58:56Z |

Greetings!

newbie's question again....

consider following query:

select Clip( raw_data,
'2013-11-08 00:00:00.00000'::datetime year to fraction( 5),
'2013-11-12 02:00:00.00000'::datetime year to fraction( 5) )
from eon_temp_sensor_tbl where id = '4321'

which in dbaccess returns pretty much what I expected:

<expression> ....

when I try to run this "select Clip(...)" from some Java code however, I do get:

java.sql.SQLException: ERROR: TimeSeries not in memory!
    at com.informix.timeseries.IfmxTimeSeries.readSQL(IfmxTimeSeries.java:550)
    at com.informix.jdbc.IfxUDT.toObject(IfxUDT.java:144)
    at com.informix.jdbc.IfxUDT.toObject(IfxUDT.java:85)
    at com.informix.jdbc.IfxResultSet.getObject(IfxResultSet.java:1529)
    at com.informix.jdbc.IfxResultSet.getObject(IfxResultSet.java:818)
    at com.ibm.zrl.eon.db.EON_DB.getTimeSeries(EON_DB.java:744)
    at com.ibm.zrl.eon.db.EON_DB.getSensorData(EON_DB.java:779)
    at com.ibm.zrl.eon.db.LoadMeterData.main(LoadMeterData.java:395)
 

so, what's the trick here? my Java code works ok for regular time-series data....

 

  • c_binding
    c_binding
    12 Posts
    ACCEPTED ANSWER

    Re: Informix irregular time-series read-out withJava

    ‏2013-11-12T10:30:02Z  in response to c_binding

    well, the trick is to say:

     execute function transpose((

    select Clip( raw_data, '2013-11-01 00:00:00.00000'::datetime year to fraction( 5), '2013-11-12 02:00:00.00000'::datetime year to fraction( 5) )

    from eon_temp_sensor_tbl where id = '4321'));

    and then process a set of java.sql.Struct and not an IfmxTimeSeries.

    consistent APIs anybody?