Java 用于扩展jdbc超时的命令行命令

Java 用于扩展jdbc超时的命令行命令,java,mysql,jdbc,Java,Mysql,Jdbc,我必须维护通过sql调用超时的java代码。错误是: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: communications link failure The last packet successfully received from the server was 7706,043 milliseconds ago. The last packet sent succesfully to the server was 2

我必须维护通过sql调用超时的java代码。错误是:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: communications link failure
The last packet successfully received from the server was 7706,043 milliseconds ago.  The last packet sent succesfully to the server was 2 milliseconds ago.
我认为这个项目正在做它应该做的事情。实际上,处理sql调用的完整返回值需要2小时!我已经编写了一个修补程序,可以修复超时问题和其他问题,但要将其发布到生产服务器,还需要一个月的时间


同时,有没有一种方法可以配置JDBC以使用更长的超时窗口?我无法触摸代码,但是否有任何方法可以使用属性文件或命令行参数来配置默认JDBC超时?

这可以通过更新用于连接SQL的URL来完成。用于扩展URL的确切参数取决于连接到哪个DB,但此网页详细介绍了这些参数:

这是有关事实的副本

mysql:jdbc:mysql://xxx.xx.xxx.xxx:3306/database?connectTimeout=60000&socketTimeout=60000 在ms中 mysql jtds jdbc:jtds:sqlserver://server:port/database;loginTimeout=60;socketTimeout=60英寸/秒