• Post Reply Bookmark Topic Watch Topic
  • New Topic

connection closed exception?

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all



When we call another method i get connetion has been closed exception .even though im creating new Connection in the second method

If i replace the code in finally block with this


It will work with out exception
so kindly help me in this issue
 
Chitti Ruddarraju
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you explain elaborately..
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are getting this exception because you are trying to close the statement in the closed connection.

So the correct order is

close the statement and then the connection.
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks now i got it....
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!