aspose file tools
The moose likes JDBC and the fly likes Newbie needs help with Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Newbie needs help with "Object has been closed" exception" Watch "Newbie needs help with "Object has been closed" exception" New topic
Author

Newbie needs help with "Object has been closed" exception

Doug Slattery
Ranch Hand

Joined: Sep 15, 2007
Posts: 294
Aloha ranchers,

I'm starting to work with JDBC and MSSQL this week. This thread is related to this thread for those who are wondering...

With help from a co-worker, I have successfully setup a JNDI datasource in Tomcat. I've also been able to connect to the server and run a simple stored procedure. After turning up the heat a bit, I've ran into a problem and have searched for an answer, which has lead me here.

The Problem:
I'm trying to set up a simple stored procedure that will return a result set (empty is ok for now) of dummy values without accessing any tables. What I have seems to fly with SQL, but on the Java side, the result set is being closed somewhere.

Here's the SP:



And here's the Java code:


The last Java line (logger.debug...) shows "returnCode [00000] Query Timeout: [10]" as expected. However, if I inspect resultSet at that line (using the Sysdeo debugger), it shows the _res->closed property as true. Thus, when I get to the set iterator, an "Object has been closed" exception is thrown. I have been quick enough on the draw at times to see the _res->closed property set to false, but it never makes it to the iterator. Even with no break points set. I suspect there is a setting somewhere, perhaps a poolable(?) one that I don't know where to look for. Anyone have any ideas?

Aloha,
Doug

-- Nothing is impossible if I'mPossible
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Newbie needs help with "Object has been closed" exception
 
Similar Threads
wrong number or types of arguments in call to 'P_RETRIEVE_OPPTY_ORDER_STATUS'
DataDirect Driver : Error " [DataDirect][SQLServer JDBC Driver]Invalid parameter binding(s)"
How to access Stored Procedure
Statement is already closed error
Only fun forwards for fun ...