Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用配置设置连接超时_Java_Spring_Jdbc - Fatal编程技术网

Java 使用配置设置连接超时

Java 使用配置设置连接超时,java,spring,jdbc,Java,Spring,Jdbc,我意识到我没有使用setQueryTimeOut方法为设置超时。我的代码正在生产中,因为理想情况下,我希望有一个解决方案,从一些配置中设置超时,而不是重新编译代码。是否有一种方法可以通过数据源配置或Java之外的任何其他属性来设置查询超时 我试图通过公认的解决方案来解决这个问题。不适合我。我得到org.springframework.beans.NotWritablePropertyException:bean类的属性“connectionProperties”无效您可以在配置中使用queryT

我意识到我没有使用
setQueryTimeOut
方法为设置超时。我的代码正在生产中,因为理想情况下,我希望有一个解决方案,从一些配置中设置超时,而不是重新编译代码。是否有一种方法可以通过数据源配置或Java之外的任何其他属性来设置查询超时


我试图通过公认的解决方案来解决这个问题。不适合我。我得到
org.springframework.beans.NotWritablePropertyException:bean类的属性“connectionProperties”无效

您可以在配置中使用
queryTimeout
字段:

  • 在JDBCTempalte xml中-