question

SagarMali-5450 avatar image
0 Votes"
SagarMali-5450 asked ·

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

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-general
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

A read time out is a command time which is raised by the client component, when the execution of a query takes longer then defined time out period; default is 30 seconds.
But with the less information no one can say more.
Is the application developed by your company? Then consult the developer to get more assistance.

0 Votes 0 ·

Permit me to point out that you are indeed to upgrade that server. You should be on SQL 2016 SP2 CU16, which is the most recent Cumulative Update. SP1 is seriously out of date.

0 Votes 0 ·

Hi, we have not get a reply from you. Did any answers could help you? If there has an answer helped, do "Accept Answer". If it is not work, please let us know the progress. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·
SagarMali-5450 avatar image
0 Votes"
SagarMali-5450 answered ·

@OlafHelper-2800 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.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TomPhillips-1744 avatar image
0 Votes"
TomPhillips-1744 answered ·

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://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver15

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CarrinWu-MSFT avatar image
0 Votes"
CarrinWu-MSFT answered ·

Hi @SagarMali-5450,

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.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.