JDBC connection slow when MSSQL installed on remote server

Frequent Visitor

Hello to all members,
we are developing web applications that use SQL Server 2016 (Express) as a database engine. We have noticed that the queries we make from application side take  20-30ms (average) when MSSQL is installed locally while, if installed on a remote machine, it take 500-600ms . We tried different versions of JDBC (now version 7.2.2) but the timing is the same. Both PC are connected on same switch.
The connection string we use is:

 

jdbc:sqlserver://${database.address};SelectMethod=cursor;database=${database.name};useUnicode=true;characterEncoding=UTF-8;charactetrResultSets=UTF-8

 

we tried to delete "SelectMethod=cursor;" and the timing improve but not significantly.

 

It is not a DNS problem because as address we use the IP.

 

Can someone tell me how to solve the problem?

 

Thanks a lot

Giovanni

0 Replies