简体   繁体   English

无法连接sql-server数据库

[英]Trouble connecting with sql-server database

I am trying to connect Alfresco Community 4.0 (installed in Tomcat7) with SQL Server 2012 but I keep having the same problem "Connection Refused". 我正在尝试将Alfresco Community 4.0(安装在Tomcat7中)与SQL Server 2012连接,但是我仍然遇到相同的问题“连接被拒绝”。 With mysql, everything worked fine. 使用mysql,一切正常。

I already turned the firewall off and enabled TCP/IP. 我已经关闭了防火墙并启用了TCP / IP。 The SQL Server Service is also running so I cannot figure out what the problem is. SQL Server服务也正在运行,因此我无法弄清楚问题出在哪里。 My driver is also working because I have another application (orbeon) using it. 我的驱动程序也正在工作,因为我有另一个应用程序(或彩虹)正在使用它。

Do you have any idea of what is happening? 您是否知道发生了什么? My configurations are the following: 我的配置如下:

db.name=alfresco
db.username=alfresco
db.password=alfresco
db.host=127.0.0.1
db.port=1433
db.driver=net.sourceforge.jtds.jdbc.Driver
db.url=jdbc:jtds:sqlserver://${db.host}:${db.port}/${db.name}
db.txn.isolation=4096

My error is: 我的错误是:

Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
    at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
    at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:215)

Thank you very much for your assistance. 非常感谢你的协助。

You need to fix this : 您需要解决此问题:

db.url=jdbc:jtds:sqlserver://${db.host}:${db.port}/${db.name}

Do it something like the following; 执行以下操作;

jdbc:jtds:sqlserver://DAN-Aladino-vs.usersad.everis.int:1433/AladinoSFA2

You need to enable the access permissions to the user to access the table. 您需要为用户启用访问表的访问权限。

here Database name is "alfresco". 这里的数据库名称是“ alfresco”。

So, You can find security --> Logins -->List of users. 因此,您可以找到安全性->登录->用户列表。 right click on user "alfresco" and go to properties.In this you will find user mapping.Now you need to enable access right's to alfersco ie user to that particular database. 右键单击用户“ alfresco”并转到属性。在这里,您将找到用户映射。现在,您需要启用对alfersco的访问权限,即用户对特定数据库的访问权限。

Try this... 尝试这个...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM