SQLServerException: The statement did not return a result set
-
Thursday, May 03, 2012 5:59 PM
Hi,
Before I post this question, I have searched the above topic "SQLServerException: The statement did not return a result set" both in Internet and this forum, however, I still can't figure out what problem I encountered in my program.
The background like this, we have a set of java web systems running on websphere 6.1 and systems connect to SQL Server 2000 using its embedded SQL 2000 JDBC driver.
Now, we need to upgrade websphere to 8.0 and back end database to SQL Server 2008 R2. The original SQL server 2000 JDBC driver no longer work. So we download SQL Server JDBC 3.0 and try on our systems. Then when executing some Stored Proc (SP) in SQL Server, JDBC returns "SQLServerException: The statement did not return a result set". Then we search on Internet and found "update statement" in SP will generate a resultset and developer needs to use "Statement.getMoreResults()" can fix this. We tried "Statement.getMoreResults()" and it really overcome this exception. This test was carried out in our original system codes.
However, when we try to minimze the scope and exact this SP part and run in another test project, executing the same piece of codes on SP but it does not generate any error and the query returns resultset normally.
I really have no idea why? Is it possible that running other codes that would cause the following JDBC codes to produce such exception?
Does anyone has similar experience?
If yes, please help to share! Many Thanks.
Ray
- Edited by Raymond Lee chun man Thursday, May 03, 2012 6:04 PM
All Replies
-
Tuesday, May 08, 2012 6:50 AMModerator
Hi Ray,
For this problem, we always use execute() to fix it. Have no idea if you have read these two blogs, both of them are useful, but if it not helps, please let me know.
http://blogs.msdn.com/b/jdbcteam/archive/2008/08/04/sqlserverexception-the-statement-did-not-return-a-result-set.aspx
Best Regards,
Iric
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed As Answer by Papy NormandModerator Tuesday, May 08, 2012 9:51 AM
- Marked As Answer by Iric WenModerator Thursday, May 10, 2012 8:56 AM

