ResultSet is from UPDATE. No Data

前端 未结 3 1883
后悔当初
后悔当初 2021-01-24 08:46

The problem occurs when executeQuery function runs, the sql statement is work correctly and gives correct results when it is runned on the sql editor. When it is runned on jdbc

3条回答
  •  别那么骄傲
    2021-01-24 09:19

    Have a look at the following documentation which explains to use execute() instead of executeQuery() and then fire a getResultSet() on the Result set that you get.

    The whole approach is to change your query into a Stored procedure and invoke the same through a CallableStatement.

    Documentation suggests:

    Although CallableStatement supports calling any of the Statement execute methods (executeUpdate(), executeQuery() or execute()), the most flexible method to call is execute(), as you do not need to know ahead of time if the stored procedure returns result sets.

    Hope this helps!

提交回复
热议问题