JDBC Connection String for SQL Server Cluster

I need to configure a JDBC connection string on SQL Server. This question is similar to the issue of connecting C # ADO.Net . This applies to JDBC connection strings.

The usual format for the JDBC string is "jdbc: sqlserver: // {host}: {port}". Now for the SQL server cluster, I have the cluster name vvv \ iii ({virtual server} {instance name}).

There is no problem setting up an ODBC connection using the New Data Source for SQL Server wizard when using the vvv \ iii string as the server name. However, it looks like the JDBC connection string requires a specific host and port.

Is there a way to connect a JDBC connection string to a SQL Server cluster?

+3
source share
5 answers

it turns out that you can use the instanceName property in the JDBC string, as described on the Microsoft Technet page in the "Named and Multiple SQL Server Instances" section. Which in my case was the following line for the vvv virtual server and database instance name iii:

"JDBC: SQLServer: // VVV; instance_name = III"

+7
source

SQL Server SQL Server . SQL Server Browser , , . 1433, , 2 , 1433. , , . .

... jdbc : JDBC: SQLServer://_/db_name; = _

JDBC: SQLServer://_: 1433/db_name; = _

, "/db_name" . , , SQL Server.

+2

. j dbc:sqlserver://{virtualserver}:1433 ( , ).

0

, . /db _name, . , ?

0

, , .

, :

jdbc:sqlserver://sqlcluster_hostname\instancename;DATABASENAME=databasename;sendStringParametersAsUnicode=false;SelectMethod=direct

Railo MSSQL.

... Rational Rail2 "-1", , "0", , . " - JDBC", JDBC , .

0

Source: https://habr.com/ru/post/1713163/


All Articles