什么是MS SQL Server 2005 Express的jTDS JDBC Connect URL [英] What is the jTDS JDBC Connect URL to MS SQL Server 2005 Express
问题描述
我正在尝试从java程序连接到本地主机上运行的MS SQL Server 2005 Express数据库。
I'm trying to connect to a MS SQL Server 2005 Express database that is running on the local host from a java program.
我尝试过相同的连接我在运行MS SQL Server 2000的另一个系统(相同的jave代码)上使用的URL(下面)。但是这不起作用。
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
有什么想法吗?
推荐答案
您确定它是正确的实例吗? SQL Express倾向于安装为命名实例,如localhost\SQLExpress,而不是标准实例。所以它会是这样的:
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:
jdbc:jtds:sqlserver://127.0.0.1:1433/Finance;instance=<instance_name>
如果这不起作用,请尝试删除实例名称,并将端口更改为使用的端口通过命名实例:
If this doesn't work, try dropping the instance name, and changing the port to the port used by the named instance:
jdbc:jtds:sqlserver://127.0.0.1:<instance_port>/Finance
否则首先尝试通过OSQL.exe工具检查连接。您还可以查看 jTDS常见问题解答。
Else try to check your connectivity through OSQL.exe tool first. You can also check the jTDS FAQ on this.
这篇关于什么是MS SQL Server 2005 Express的jTDS JDBC Connect URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!