SQLServerException: The statement did not return a result set
-
2012년 5월 3일 목요일 오후 5:59
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
- 편집됨 Raymond Lee chun man 2012년 5월 3일 목요일 오후 6:04
모든 응답
-
2012년 5월 8일 화요일 오전 6:50중재자
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.- 답변으로 제안됨 Papy NormandModerator 2012년 5월 8일 화요일 오전 9:51
- 답변으로 표시됨 Iric WenModerator 2012년 5월 10일 목요일 오전 8:56

