BIRT generates error while reading Long Datatype
This error caused by the Oracle SQL driver closing the stream when reading the recordset data for Long datatypes if any other operation is performed on the recordset before reading the Long Datatype column.
More info can be found here in Oracale documentation
https://docs.oracle.com/cd/A81042_01/DOC/java.816/a81354/basic4.htm
“If you do not use the SELECT-list order to access data, then you can lose the stream data. That is, if you bypass the stream data column and access data in a column that follows it, the stream data will be lost. For example, if you try to access the data for the NUMBER column before reading the data from the stream data column, the JDBC driver first reads then discards the streaming data automatically. This can be very inefficient if the LONG column contains a large amount of data.”
To avoid this error make sure you fetch the LONGDATATYPE column in the fetch function before reading any other column.
if (!maximoDataSet.fetch())
return (false);
// Add a line for each output column
// The specific get method should match the data type of the output column.
row["LONGDATATYPEATTR1"] = maximoDataSet.getString("LONGDATATYPEATTR1"); // Read this column first
row["ATTR1"] = maximoDataSet.getString("ATTR1");
row["ATTR2"] = maximoDataSet.getString("ATTR2");
row["ATTR3"] = maximoDataSet.getTimestamp("ATTR3");
row["ATTR4"] = maximoDataSet.getInt("ATTR4");
Comments
Post a Comment