Menu

#58 Support named pipe format used with SQL clustering

open
nobody
None
5
2017-11-08
2009-06-05
Dan Fleet
No

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.

Discussion

  • Dan Fleet

    Dan Fleet - 2009-06-05

    changed source files

     
  • Dan Fleet

    Dan Fleet - 2009-06-05

    unified diffs

     
  • Dan Fleet

    Dan Fleet - 2009-06-05

    test driver

     
  • Anonymous

    Anonymous - 2013-06-08

    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?

     
  • Anonymous

    Anonymous - 2017-11-08

    We had to create manual Windows Firewall rules inbound and outbound on both nodes of SQL cluster to allow TCP traffic on 58241

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.