IBM Worklight 6.1 - 使用SQL适配器连接到MS SQL失败 [英] IBM Worklight 6.1 - Failed connecting to MS SQL using SQL adapter
问题描述
我正在尝试将我的适配器连接到SQL Server 2012 Express数据库,但我无法完全正确。我从这里下载了一个连接器: http://msdn.microsoft.com/en -us / sqlserver / aa937724.aspx ,并将其添加到Worklight Studio中的 server \lib
文件夹中。
I am trying to connect my adapter to a SQL Server 2012 Express database, but I can't quite get it right. I have downloaded a connector from here: http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx, and added it to the server\lib
folder in Worklight Studio.
我的定义如下:
<dataSourceDefinition>
<driverClass>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClass
<url>jdbc:sqlserver://localhost:1433;database=MyDB</url>
<user>MyUser</user>
<password>MyPassword</password>
</dataSourceDefinition>
驱动程序类似乎是正确的,但URL却没有。任何人都可以指出我正确的方向吗?
The driver class seems to be right, but the URL don't. Can anyone point me in the right direction?
PS。我的环境如下,worklight 6.1,jre7u45,windows 8,SQL Server 2012 Express。
PS. My environment is as follows, worklight 6.1, jre7u45, windows 8, SQL Server 2012 Express.
推荐答案
关于连接错误,请参阅如果以下内容有帮助:
Regarding the connection error, see if the following will help:
- http://www.coderanch.com/t/306316/JDBC/databases/SQLServerException-TCP-IP-connection-host
...打开SQL Server配置管理器 - > SQL
的协议SQLEXPRESS,选择TCP /的属性IP。在选项卡IP地址中,将IPAll中的TCPPort设置为
到1433
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bd5bb6c2-a4d9-4071-b2e6-a6c83970b212/commicrosoftsqlserverjdbcsqlserverexception-the-tcpip-connection-to-the- host-has-failed?forum = sqlreportingservices
...请注意,JDBC URL结构与
斜杠和反斜杠的使用不同,例如:
`jdbc:sqlserver:// localhost \SQLEXPRESS / Datab ases / EPS:1357
... note that the JDBC URL structure is different re its use of slashes and backslashes, for example: `jdbc:sqlserver://localhost\SQLEXPRESS/Databases/EPS:1357
这篇关于IBM Worklight 6.1 - 使用SQL适配器连接到MS SQL失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!