我正在尝试启动tomcat服务器,但出现以下错误: The TCP/IP connection to the host 127.0.0.1, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
server.xml如下所示:
<Resource name="jdbc/ProcessEngine"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
uniqueResourceName="Camunda"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433/Camunda"
defaultTransactionIsolation="READ_COMMITTED"
username="sa"
password=".v>>4T^[#f/B)9Qx"
maxTotal="20"
minIdle="5"
maxIdle="20" />
ps.tcp/ip已启用,tcp端口id等于1433。此外,我可以通过microsoft sql server management studio进行连接:
1条答案
按热度按时间7cjasjjr1#
您必须在sql server配置-管理中启用tcp/ip传入连接,默认情况下端口未打开。
在开始菜单上,单击所有程序>microsoft sql server >配置工具>sql server配置管理器。
单击sql server 服务。
展开sql server 网络配置节点,然后选择mssqlserver的协议(sql示例名称)。
右键单击tcp/ip,然后单击启用。