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/14.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.sql.SQLException:org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int)方法尚未实现_Java_Spring_Spring Batch - Fatal编程技术网

java.sql.SQLException:org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int)方法尚未实现

java.sql.SQLException:org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int)方法尚未实现,java,spring,spring-batch,Java,Spring,Spring Batch,我正在处理Spring批处理项目,同时连接到postgresql数据库,我收到下面的错误消息 java.sql.SQLException:org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int)方法尚未实现 我怎么解决这个问题请帮我解决。 我使用的是postgres 9.4-1201-jdbc41驱动程序版本 和SpringJDBC4.1.4.0版本 Stack trace at org.quartz.simpl.S

我正在处理Spring批处理项目,同时连接到postgresql数据库,我收到下面的错误消息

java.sql.SQLException:org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int)方法尚未实现

我怎么解决这个问题请帮我解决。 我使用的是postgres 9.4-1201-jdbc41驱动程序版本 和SpringJDBC4.1.4.0版本

Stack trace
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.sql.SQLException: Method org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int) is not yet implemented.
    at org.postgresql.Driver.notImplemented(Driver.java:753)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.setQueryTimeout(AbstractJdbc2Statement.java:668)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setQueryTimeout(NewProxyPreparedStatement.java:1800)
    at org.springframework.jdbc.datasource.DataSourceUtils.applyTimeout(DataSourceUtils.java:275)
    at org.springframework.jdbc.core.JdbcTemplate.applyStatementSettings(JdbcTemplate.java:1399)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)
    ... 37 more
]
Execution failure Stack trace: [org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [SELECT * FROM patient where id =?  ]; SQL state [0A000]; error code [0]; Method org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int) is not yet implemented.; nested exception is java.sql.SQLException: Method org.postgresql.jdbc3.Jdbc3PreparedStatement.setQueryTimeout(int) is not yet implemented.]

错误信息很清楚。它还没有实现,所以要么在实现它的地方找到一个新的驱动程序,要么如果一个驱动程序不存在,就不要使用该方法

最新、最先进的驱动程序是。如果这个方法不起作用,那么你就不能使用这个方法


与之前类似,是由在连接池中使用测试查询引起的。在最新的驱动程序中实现了它,但是无论如何都不应该使用测试查询,因为存在
连接
方法,该方法明确用于测试有效性。

您应该在代码块中插入错误以获得更好的效果lisibility@user3715296猜猜这意味着什么?@user3715296您使用的是哪个Java版本?我们使用的是JDK1.7,我链接的驱动程序无法工作。这是1.8版的。你确定你测试过了吗?还有1.7的最新版本。我刚刚检查了源代码,并实现了
setQueryTimeout()
。你没有使用正确的驱动程序。你说你测试了最新的,但那不可能是真的。由于您不知道如何使用正确的驱动程序,因此我几乎无法为您提供帮助。