How to get ResultSet from executeBatch?

I need to get a result set from an executable package:

    String [] queries = {"create volatile table testTable as (select * from orders) with data;", 
                         "select top 10 * from testTable;" , 
                         "drop table testTable" };
     for (String query : queries) {
        statement.addBatch(query);
    }
    statement.executeBatch();

Ones I execute the package, how can I get the result set from the select query?

+3
source share
1 answer

In short, you should not. A simple multiple execute () should be used.

As in javadocexecuteBatch() , it should not support the getResultSet () / getMoreResults () API.

Additionally, the JDBC ™ 4.0 Specification # 14.1.2

DDL DML, , . executeBatch BatchUpdateException, - .

JDBC , .

+4

All Articles