Jump to content
Changes to the Jaspersoft community edition download ×

Oracle LONG Data Type - How to retrieve?


2004 IR Help

Recommended Posts

By: Amanda Gellhouse - amandawai

Oracle LONG Data Type - How to retrieve?

2004-02-20 15:35

I am trying to access a field containing a LONG data type. I have read the fields to the report using a select * statement. When I try to compile the report (not yet referencing the LONG field in the report itself) I get the following error:

java.sql.SQLException: Stream has already been closed

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)

 

at oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl.java:1087)

 

at oracle.jdbc.driver.OracleStatement.getBytesInternal(OracleStatement.java:2489)

 

at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2543)

 

at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:305)

 

at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)

 

at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:147)

 

at dori.jasper.engine.fill.JRBaseFiller.next(JRBaseFiller.java:748)

 

at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:163)

 

at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:496)

 

at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:144)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:350)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:290)

 

at IReportCompiler.main(IReportCompiler.java:147)

 

 

NESTED BY :

 

dori.jasper.engine.JRException: Unable to get value for field 'NOTES' of class 'java.lang.Byte'

 

at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:272)

 

at dori.jasper.engine.fill.JRBaseFiller.next(JRBaseFiller.java:748)

 

at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:163)

 

at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:496)

 

at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:144)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:350)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:290)

 

at IReportCompiler.main(IReportCompiler.java:147)

 

Caused by: java.sql.SQLException: Stream has already been closed

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)

 

at oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl.java:1087)

 

at oracle.jdbc.driver.OracleStatement.getBytesInternal(OracleStatement.java:2489)

 

at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2543)

 

at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:305)

 

at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)

 

at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:147)

 

... 7 more

 

 

 

 

By: Giulio Toffoli - gt78

RE: Oracle LONG Data Type - How to retrieve?

2004-02-20 16:14

Declare the NOTES field as String, not as a byte.

 

Giulio

 

 

 

 

By: Amanda Gellhouse - amandawai

RE: Oracle LONG Data Type - How to retrieve?

2004-02-20 16:16

That doesn't seem to work either.

java.sql.SQLException: Stream has already been closed

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)

 

at oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl.java:1087)

 

at oracle.jdbc.driver.OracleStatement.getBytesInternal(OracleStatement.java:2489)

 

at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2543)

 

at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:305)

 

at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)

 

at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:263)

 

at dori.jasper.engine.fill.JRBaseFiller.next(JRBaseFiller.java:748)

 

at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:163)

 

at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:496)

 

at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:144)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:350)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:290)

 

at IReportCompiler.main(IReportCompiler.java:147)

 

 

NESTED BY :

 

dori.jasper.engine.JRException: Unable to get value for field 'NOTES' of class 'java.lang.String'

 

at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:272)

 

at dori.jasper.engine.fill.JRBaseFiller.next(JRBaseFiller.java:748)

 

at dori.jasper.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:163)

 

at dori.jasper.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:496)

 

at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:144)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:350)

 

at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:290)

 

at IReportCompiler.main(IReportCompiler.java:147)

 

Caused by: java.sql.SQLException: Stream has already been closed

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)

 

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)

 

at oracle.jdbc.dbaccess.DBDataSetImpl.getStreamItem(DBDataSetImpl.java:1087)

 

at oracle.jdbc.driver.OracleStatement.getBytesInternal(OracleStatement.java:2489)

 

at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2543)

 

at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:305)

 

at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)

 

at dori.jasper.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:263)

 

... 7 more

 

 

 

Abnormal termination!

 

 

 

 

By: Amanda Gellhouse - amandawai

Oracle LONG Data Type - New Insight

2004-02-20 19:28

As I mentioned previously, I'm unable to compile & generate a report when it contains a data type LONG field (Oracle), regardless of the java type I assign it. When retrieving a LONG using Java, you just need to fetch it as a string, so I'm wondering if this is some type of bug in JasperReports. Does anyone have any experience with this?

 

 

 

 

By: Sohan Kasula - skasula

RE: Oracle LONG Data Type - New Insight

2004-05-28 15:10

Declare the field type as java.io.Inputstream in the field values. In the text field declare the type as String and in the text field expression convert the field type to String.

 

 

 

 

By: Sohan Kasula - skasula

RE: Oracle LONG Data Type - How to retrieve?

2004-05-28 15:42

I also tried declaring the type as String in jasper reports and it works fine. I used TEXT column from ALL_VIEWS view in oracle. Both the field type and text field are declared as String and report generates fine.

I would look at the total length of the field and use the first approach. Is there any timing constraint on the server. for example if a certain time lapses without any activity then the connection is dropped automatically. these are just foods for thought.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...