【发布时间】:2020-05-20 10:03:30
【问题描述】:
我想知道我们需要在public void setQueryTimeout(int queryTimeout) 中传递jdbcTemplate 中的值的类型。文件说
> Set the query timeout for statements that this JdbcTemplate executes.
> <p>Default is -1, indicating to use the JDBC driver's default (i.e. to
> not pass a specific query timeout setting on the driver). <p>Note: Any
> timeout specified here will be overridden by the remaining transaction
> timeout when executing within a transaction that has a timeout
> specified at the transaction level. @see
> java.sql.Statement#setQueryTimeout
想知道 queryTimeout 是 milliseconds、seconds 还是 minutes
【问题讨论】:
-
奇怪的是它没有指定是秒还是毫秒。您必须基于互联网上人们的解决方案。 :)
-
@Young Emil `Statement.setQueryTimeout` 提到输入参数的单位
-
@mantri,我认为这个问题针对的是
JdbcTemplate.setQueryTimeout,而不是Statement类。
标签: java jdbc java-8 jdbctemplate query-timeout