【问题标题】:How to set connection timeout while creating JDBC SQL Driver connection(JAVA)?创建 JDBC SQL 驱动程序连接(JAVA)时如何设置连接超时?
【发布时间】:2016-07-29 11:07:22
【问题描述】:

建立连接需要 60 分钟。我该如何解决?

试过

Connection conn = DriverManager.getConnection("jdbc:sqlserver://" + host + ":" + port + ";databaseName=" + database
                    + ";", uname, passwd+ "");

谢谢

【问题讨论】:

  • 当你的连接字符串是 SQL Server 时,为什么你用 mysql 标记了这个问题?

标签: java mysql jdbc


【解决方案1】:

取决于特定的 JDBC 驱动程序。

你可能想看看这里:

http://www.cubrid.org/blog/dev-platform/understanding-jdbc-internals-and-timeout-configuration/

【讨论】:

    猜你喜欢
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    • 2018-11-27
    • 2014-09-24
    • 2013-11-11
    • 2020-07-13
    • 2012-03-09
    • 2013-09-20
    相关资源
    最近更新 更多