Y
Y
Yasuro2019-02-02 21:14:26
Java
Yasuro, 2019-02-02 21:14:26

Why does the data from the ResultSet disappear after the JDBC connection is closed?

There are connections - connection.
var statement=connection.createStatement();
var resultSet=statement.executeQuery(query);
resultSet.next()// will be true here;
statement.close();
resultSet.next()// here it will be false
I need to pass the data in the ResultSet format further, but connections can already be closed, why keep it open.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
al_gon, 2019-02-03
@al_gon

Because it will also be closed.
https://docs.oracle.com/javase/8/docs/api/java/sql...

M
Michael, 2019-02-04
@SnowBearRu

As you wrote in the comment to map on the object. If you don't understand the structure of the . map to an array map ( row, column \ value) array = number of selected rows.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question