使用 JDBC 连接到 SQL Server LocalDB [英] Connecting to SQL Server LocalDB using JDBC

查看:44
本文介绍了使用 JDBC 连接到 SQL Server LocalDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 JDBC 连接到 SQL Server LocalDB?它似乎(截至 2011 年 12 月)这是不可能的.

Is it possible to connect to a SQL Server LocalDB using JDBC? It appears that (as of Dec 2011) it was not possible.

您知道解决方法或状态变化吗?

Do you know of a workaround or change in status?

推荐答案

是否可以使用 JDBC 连接到 SQL Server LocalDB?

不适用于 Microsoft 的 JDBC 驱动程序.

Not with Microsoft's JDBC Driver.

jTDS JDBC 驱动程序支持命名管道.

The jTDS JDBC driver supports named pipes.

执行 SqlLocalDB.exe 信息 MyInstance 将为您(以及其他信息)获取实例管道名称,例如np:.pipeLOCALDB#F365A78E sqlquery".

Executing SqlLocalDB.exe info MyInstance will get you (along with other info) the instance pipe name such as "np:.pipeLOCALDB#F365A78E sqlquery".

您是否知道解决方法或状态变化?

可能的解决方法是使用替代 JDBC 驱动程序或切换到 SQL Server 2012 Express 而不是 LocalDB.

Possible workarounds are using alternative JDBC drivers or switching to SQL Server 2012 Express instead of LocalDB.

详情:

Microsoft JDBC 驱动程序与 LocalDB 不兼容.

The Microsoft JDBC Driver is not compatible with LocalDB.

不幸的是,Microsoft JDBC 驱动程序不支持连接到 LocalDB.发生这种情况是因为 LocalDB 仅支持命名管道连接,而我们当前的 JDBC 实现不支持命名管道.开发人员的一种可能解决方法是下载并安装 SQLExpress,并启用其 TCP/IP 支持."

"Unfortunately, the Microsoft JDBC Driver does not support connecting to LocalDB. This happens because LocalDB only supports Named Pipes connections and our current JDBC implementation does not support Named Pipes. One possible work around for your developers is to download and install SQL Express, which and enable its TCP/IP support."

路易斯·费尔南多·桑托斯 (MSFT) 7 月 6 日, 2012

不幸的是,JDBC 驱动程序目前不支持 LocalDB,没有简单的解决方法.团队知道这个缺失的功能,但提交连接项总是有助于 DCR 跟踪和优先级排序."

"Unfortunately JDBC driver doesn't support LocalDB at this moment and there is no easy workaround. The team is aware of this missing feature, but filing a connect item is always helpful for DCR tracking and prioritization."

Krzysztof Kozielczyk -MSFT 2011 年 12 月 22 日

您今天使用 SQL Server Express 进行本地开发吗?您是在 Windows 还是其他平台上工作?很高兴听到更多关于您希望如何将 LocalDB 与您的 Java 应用程序结合使用的信息."

"Do you use SQL Server Express today for local development? Are you working on Windows or another platform? It would be great to hear more about how you would like to use LocalDB with your Java app."

沙米莎·雷迪,程序经理 Microsoft JDBC Driver for SQL Server,Microsoft JDBC Driver 产品团队 2012 年 4 月 13 日

这篇关于使用 JDBC 连接到 SQL Server LocalDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆