zoukankan      html  css  js  c++  java
  • (转)jdbc 调用 sql server 的存储过程时“该语句没有返回结果集”的解决方法

    本文转载自:http://hedyn.iteye.com/blog/856040

    在JDBC中调用SQL Server中的存储过程时出现如下异常:

        com.microsoft.sqlserver.jdbc.SQLServerException: 该语句没有返回结果集。  
                at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)  
                at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:394)  
                at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:340)  
                at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)  
                at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)  
                at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)  
                at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)  
                at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:283)  

    解决方法:在存储过程首行加上

    SET NOCOUNT ON  
  • 相关阅读:
    异常作业
    多态作业
    封装和继承作业
    类和对象作业
    多重循环、方法作业
    选择语句+循环语句作业
    数据类型和运算符作业
    初识Java作业
    C 数据结构堆
    C基础 旋转数组查找题目
  • 原文地址:https://www.cnblogs.com/wpcnblog/p/3731647.html
Copyright © 2011-2022 走看看