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

查看:395
本文介绍了使用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:\.\ pipe \ LOCALDB#F365A78E \ tsql \ query".

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

您知道解决方法或状态更改吗?

可能的解决方法是使用替代的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实现不支持命名管道.开发人员可能的解决方法是下载并安装SQL Express,并启用其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或其他平台上工作吗?很高兴听到更多有关您希望如何在Java应用程序中使用LocalDB的信息."

"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."

Shamitha Reddy,程序管理器SQL Server的Microsoft JDBC驱动程序,Microsoft JDBC驱动程序产品团队2012年4月13日

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

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