MS SQL Server 2005 Express 的 jTDS JDBC 连接 URL 是什么
我正在尝试从 java 程序连接到在本地主机上运行的 MS SQL Server 2005 Express 数据库。
我尝试了与运行 MS SQL Server 2000 的另一个系统(相同的 jave 代码)上使用的相同的连接 URL(如下)。但这不起作用。
jdbc:jtds:sqlserver://127.0.0.1:1433/Finance
有任何想法吗?
I'm trying to connect to a MS SQL Server 2005 Express database that is running on the local host from a java program.
I have tried the same connect URL (below) that I used on another system (same jave code) that was running MS SQL Server 2000. But that does not work.
jdbc:jtds:sqlserver://127.0.0.1:1433/Finance
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您确定这是正确的实例吗? SQL Express 倾向于安装为命名实例,例如“localhost\SQLExpress”,而不是标准实例。 所以它会是这样的:
如果这不起作用,请尝试删除实例名称,并将端口更改为命名实例使用的端口:
否则尝试首先通过 OSQL.exe 工具检查您的连接。 您还可以查看jTDS 常见问题解答。
Are you sure it is the correct instance? SQL Express tends to install as named instance, like "localhost\SQLExpress", instead of a standard instance. So it would be something like:
If this doesn't work, try dropping the instance name, and changing the port to the port used by the named instance:
Else try to check your connectivity through OSQL.exe tool first. You can also check the jTDS FAQ on this.
我建议 MicSim 的 url:
检查 this 获取 jTDS Url 信息。
这还提供了一些有趣的信息来帮助排除故障jtds 到 sql express 的各种问题。
祝你好运。 让我们知道怎么回事。
I would suggest MicSim's url:
Check this for jTDS Url Info.
This also has some interesting information to help troubleshoot jtds to sql express sorts of problems.
Good luck. Let us know how it goes.
要检查 TCP/IP 是否已启用且端口是否未被阻止,可以使用“telnet 1433”。 在 telnet 无法连接之前,jTDS 也不会连接。
在 Windows 上启用 telnet 客户端
http://social.technet.microsoft.com/wiki/contents/articles/910.how-to-enable-telnet-client-in-windows-7.aspx
To check whether TCP/IP is enabled and the port is not blocked you can use "telnet 1433". Until telnet doesn't connect, jTDS won't either.
to enable telnet client on windows
http://social.technet.microsoft.com/wiki/contents/articles/910.how-to-enable-telnet-client-in-windows-7.aspx
默认情况下禁用 SQL Server Browser 服务。 如果您正在开发 .Net 应用程序,则无需启动 SQLBrowser,但如果您在 Java 中使用 JTDS,则需要启动它。
示例(无需指定sql server端口)。
SQL Server Browser service is disabled by default. If you're developing .Net apps, you do not need to start SQLBrowser, but if you're using JTDS in Java, you will need to have it started.
Example (no need to specify the sql server port).
你可以使用这个::
you can use this::