Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: Stream has already been closed

 
Fernando Dominguez
Ranch Hand
Posts: 106
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm using ORACLE when I execute this method I get a java.sql.SQLException: Stream has already been closed.
Could anyone take a quick look at the following code, please?



Thanks.
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you provide the stack trace? does it tell you which line the exception happened?
 
Fernando Dominguez
Ranch Hand
Posts: 106
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course,

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at core.orm.Orm.getDetalleEncargo(Orm.java:102)

can you re post the line of code at 102 from Orm.java

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

For ensure, check your SQL directly in database.. (in this case the SQL is correct)..


You could change your code for while to if, because the result is only one record, isn't it?..


try to remove this code, because i think it's useless


in that code there's try.. catch.. block, its mean the exception would be caught if happened.., so why we've to throw the exception again (in the catch block)?..

may i know the sequence's method call in your application?..

please correct me if i'm wrong..

Thanks..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic