SQLServerException: The statement did not return a result set


  • 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.


    יום חמישי 03 מאי 2012 17:59