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

Sagar Mali 1 Reputation point

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.
13,345 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Sagar Mali 1 Reputation point

    @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,721 Reputation points

    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":


    0 comments No comments

  3. CarrinWu-MSFT 6,866 Reputation points

    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,

    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