com.microsoft.sqlserver.jdbc.SQLServerException: 该语句没有返回结果集。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:800)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(SQLServerStatement.java:616)
at action.Booking_a.InsertBooking(Booking_a.java:24)
at main.Start.main(Start.java:50)
存储过程加上setnocounton 也不行
请问还有什么解决方法吗?
存储过程在数据库客户端执行正常吗
public boolean InsertBooking(String patientno,String bookableno)
{
con=db.getConnection();
String sql="execute insert_booking_procedure @pno="+patientno+",@bookableno="+bookableno+"";
try {
sta= con.createStatement();
rs = sta.executeQuery(sql);
System.out.print("预约成功");
}catch (SQLException e) {
e.printStackTrace();
System.out.print("预约失败");
return false;
}
return true;
}//插入预约