I need to setup a JDBC connection string to SQL Server. This question is similar to the the C# ADO.Net connection question. This one is specific to JDBC connection strings.
The usual format for the JDBC string is "jdbc:sqlserver://{host}:{port}". Now, for a SQL server cluster I have a cluster name vvv\iii ({virtual server}{instance name}).
There's no problem setting up an ODBC connection through the "New Data Source to SQL Server" wizard when using the vvv\iii string as the server name. However it seems the JDBC connection string requires a specific host and port.
Is there a way to make a JDBC connect string to a SQL Server cluster?
it turns out that you can use the "instanceName" property within the JDBC string, as documented on the Microsoft Technet page in section "Named and Multiple SQL Server Instances". What worked in my case was the following string for virtual server vvv and database instance name iii:
"jdbc:sqlserver://vvv;instanceName=iii"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With