|
3 | 3 | import io.elastic.api.ExecutionParameters;
|
4 | 4 | import io.elastic.api.Message;
|
5 | 5 | import io.elastic.api.Function;
|
| 6 | +import io.elastic.api.ShutdownParameters; |
6 | 7 | import io.elastic.jdbc.query_builders.Query;
|
7 | 8 | import io.elastic.jdbc.utils.QueryFactory;
|
8 | 9 | import io.elastic.jdbc.utils.Utils;
|
9 | 10 | import java.sql.Connection;
|
10 | 11 | import java.sql.SQLException;
|
| 12 | +import java.sql.Statement; |
11 | 13 | import java.util.ArrayList;
|
12 | 14 | import javax.json.Json;
|
13 | 15 | import javax.json.JsonObject;
|
14 | 16 | import javax.json.JsonString;
|
15 | 17 | import org.slf4j.Logger;
|
16 | 18 | import org.slf4j.LoggerFactory;
|
17 | 19 |
|
18 |
| -public class SelectAction implements Function { |
19 | 20 |
|
| 21 | +public class SelectAction implements Function { |
20 | 22 | private static final Logger LOGGER = LoggerFactory.getLogger(SelectAction.class);
|
21 | 23 | private static final String SQL_QUERY_VALUE = "sqlQuery";
|
22 | 24 | private static final String PROPERTY_NULLABLE_RESULT = "nullableResult";
|
@@ -52,9 +54,8 @@ public void execute(ExecutionParameters parameters) {
|
52 | 54 | sqlQuery = Query.preProcessSelect(sqlQuery);
|
53 | 55 | LOGGER.debug("Got SQL Query");
|
54 | 56 | ArrayList<JsonObject> resultList;
|
55 |
| - try(Connection connection = Utils.getConnection(configuration)){ |
56 |
| - resultList = query.executeSelectQuery(connection, sqlQuery, body); |
57 |
| - } |
| 57 | + Connection connection = Utils.getConnection(configuration); |
| 58 | + resultList = query.executeSelectQuery(connection, sqlQuery, body); |
58 | 59 | for (int i = 0; i < resultList.size(); i++) {
|
59 | 60 | LOGGER.debug("Columns count: {} from {}", i + 1, resultList.size());
|
60 | 61 | LOGGER.info("Emitting data...");
|
|
0 commit comments