Step 1: Check if the Named instance is running in a static or dynamic port
Open SQL Server Configuration Manager.
Navigate to SQL Server Network Configuration → Protocols for [Instance Name].
Right-click TCP/IP → Properties.
Check the IP Addresses tab:
Static Port: (typically under IPAll section).
TCP Port: Contains a specific port number (e.g., 1433 or any other assigned port).
TCP Dynamic Ports: Should be empty.
Dynamic Port: (typically under IPAll section).
TCP Port: Will be empty.
TCP Dynamic Ports: Contains 0 (f set to 0, SQL Server assigns a port dynamically) or a specific dynamic port number.
SQL Server Browser: Make sure the "SQL Server Browser" Service is running on SQL Server installed machine.
Verify UDP Port Accessibility: Named instance connections require the UDP port (Default: 1434) to be reachable. The MSSQL driver uses UDP port 1434 to retrieve information about available SQL Server instances.
If the UDP port is inaccessible, you may encounter the following error:
java.sql.SQLException: "Unable to get information from SQL Server"
This indicates the driver was unable to fetch details about the running instances.
Note: On SQL Server 2005 the SQL Browser service must be running on the server host as the instance name lookup port UDP 1434 is hosted by this service on SQL Server 2005 rather than the SQL Server itself. The default installation does not configure the SQL Browser service to start automatically, so you must do it manually.
If your SQL instances are configured to use static ports, you can specify the port number directly instead of the instance name.
Possible error cases: