Facing com.microsoft.sqlserver.jdbc.SQLServerException: Read timed out

Sagar Mali 1 Reputation point
2021-03-18T14:31:36.72+00:00

I have following details - DB server - Windows Server 2016 Datacenter SQL Server version - Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,758 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Sagar Mali 1 Reputation point
    2021-03-18T15:18:33.9+00:00

    @Olaf Helper Thanks for replying . Yes application developed by my company. Can you tell if i can override this default timeout ?

    Also, db server & client in cloud as ec2 instances, in logs i can see it starts inserting rows expected but throws error after some time.

    Also it use connection pool.

    0 comments No comments

  2. Tom Phillips 17,716 Reputation points
    2021-03-18T18:28:06.997+00:00

    This is really a JDBC question, not a SQL Server question. SQL Server does not have a timeout.

    The default timeout is -1 (infinite) in the JDBC driver. So you must already be setting it to something.

    Please see "queryTimeout":

    https://learn.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver15

    0 comments No comments

  3. CarrinWu-MSFT 6,856 Reputation points
    2021-03-19T06:43:20.12+00:00

    Hi @Sagar Mali ,

    Your question is related to Java and I am not familiar with it. But here have some check-list may help you:

    1. Please make sure that you can ping the server that has SQL Server installed.
    2. Make sure that the SQL Server instance is running well.
    3. Make sure that  the codes used to establish connection are correct.

    And please refer to Connecting to SQL Server with the JDBC driver and Troubleshooting connectivity to get more information.

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments