R
R
Riard Brugekaaim2015-07-13 09:18:55
Java
Riard Brugekaaim, 2015-07-13 09:18:55

How to troubleshoot a database connection?

In fact, I need to carry out the following actions:
Connecting, disconnecting and searching for signs of life in the database.
The question is how it is done in hibernate.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai, 2015-07-13
@j_wayne

In JDBC4, the driver does this by implementing the Connection#isValid() method.
Earlier versions use (at least in connection pool libraries) validation queries like SELECT 1;
By the way, I'm not sure that hibernate checks connections. Most likely this is usually done by pools.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question