I have a requirement to connect to a named instance on a SQL Server cluster via a named pipe, using the default cluster named pipe name, using jtds.
From what I can see, the named pipe jTDS URL syntax doesn't support the extra values necessary to connect to a cluster. The format for a cluster named pipe, by default, is:
\<SQLHOST>\pipe\$$\<CLUSTER_NAME>\MSSQL$<INSTANCE_NAME>\sql\query
Where 'CLUSTER_NAME' is the 'virtual server' name for the cluster.
I've done some digging on the forums and into the source code, and do not see a mechanism within jTDS that would let me specify the cluster virtual server name on the named pipe path. I've patched the jar code to let me do this as a proof of concept.
The patch is to accept (yet another) parameter called 'clusterName' that takes the name of the cluster, and puts "/$$/clusterName" in the appropriate part of the pipe path in SharedLocalNamedPipe and SharedNamedPipe. It only applies if using named pipes.
Example URL:
jdbc:jtds:sqlserver://192.168.0.100;namedPipe=true;domain=MYDOMAIN;instance=MYNAMEDINSTANCE;clusterName=CLUSTER01;useJCIFS=true
This generates named pipe paths as follows, depending on if using JCIFS or not:
\192.168.0.100\pipe\$$\CLUSTER01\MSSQL$MYNAMEDINSTANCE\sql\query
smb://192.168.0.100/IPC$/$$/CLUSTER01/MSSQL$MYNAMEDINSTANCE/sql/query
See the attached for the changed source files as well as unified diffs. In addition, there is a simplistic test driver.
Anonymous
changed source files
unified diffs
test driver
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hello, I'm facing this exact problem at the moment. Was this ever implemented in the mainstream code as a feature? Or do I need to include the above classes to the jar myself?
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
We had to create manual Windows Firewall rules inbound and outbound on both nodes of SQL cluster to allow TCP traffic on 58241