Request Timeout for JDBI

1) Can I configure a global queryTimout value for the mysql Dropwizard JDBI connector? What is the default value? I do not want to use @QueryTimeOut in every single DAO.

2) What about java. sql. Statement.Connection where is the networkTimeout parameter , which is defined as:

milliseconds, the driver will wait for the database request to complete. If the limit is exceeded, an SQLException is thrown.

Should I treat this as a request timeout?

+5
source share
1 answer

, . JDBC: org.jdbi.v3.core.Jdbi - :

Jdbi.create(datasource)
.configure(SqlStatements.class, stmt -> {
    stmt.setQueryTimeout(timeout);
});
0

Source: https://habr.com/ru/post/1657514/


All Articles