SQL Server connection error using name instance

77 Views Asked by At

I am using an SQL Server named instance, and I used the JDBC URI format,

jdbc:sqlserver://EC2AMAZ-LKTS\MSSQLSERVER:1433;encrypt=false;

in simple Java code, but it returns the below error.

Format: sqlserver://\:1433;encrypt=false;

I have verified TCP/IP is enabled on my end and port 1433 is configured under IPVII. I verified 1433 port inbound and outbound rules, and they seem to be good.

Why I am getting this error?

The TCP/IP connection to the host EC2AMAZ-LKTS, port 1433 has failed. Error: "EC2AMAZ-LKTS. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall

1

There are 1 best solutions below

4
Ave Leo On

It seems like you are encountering an issue with your SQLServer named instance and the JDBC URI in your Java code. Firstly, ensure that your JDBC URI format is correct; it should be in the format "jdbc:sqlserver://:1433;encrypt=false;". Double-check the InstanceName and make sure it matches the actual name of your SQL server instance. Additionally, confirm that TCP/IP is enabled and that port 1433 is correctly configured under IPVII. Since you've already verified inbound and outbound rules for port 1433, consider checking for any firewall or security group settings on your EC2 instance that might be affecting the connection. Additionally, review SQL Server logs for any specific error messages that could provide more insight into the issue. If the problem persists, you may want to consult the SQL Server documentation or seek assistance from relevant forums for further troubleshooting.