Connecting to SQL Server from java with TCP disabled

前端 未结 3 1345
臣服心动
臣服心动 2021-01-05 00:49

I\'m trying to connect to a local database (SQL Server 2008) from Java. I have disabled the tcp connections per customer requirements and I can\'t connect. I have to disable

3条回答
  •  忘掉有多难
    2021-01-05 01:44

    I know this is an old question. However, I was searching how to configure Shared Memory access to SQL Server using the Microsoft JDBC driver and came across it. The definite answer is: The Microsoft JDBC driver only supports TCP connections, not shared memory nor named pipes. Now that the driver is open source, you can check that yourself in the source code on GitHub: The relevant code is the local class TDSChannel in toplevel class IOBuffer (currently found here). Method open in this class only accesses tcp sockets (and SSL sockets), but not any shared memory or named pipes.

    This means that using other drivers than the MS JDBC driver is the only possibility when you cannot or do not want to use TCP/IP connections.

提交回复
热议问题