简体   繁体   English

连接到带有jdbc错误的SQL Server

[英]connecting to sql server with jdbc error

I'm trying to connect to a sql server via the jdbc driver but keep getting this error: 我正在尝试通过jdbc驱动程序连接到sql服务器,但始终收到此错误:

Error connecting to the specified data source: The TCP/IP connection to the host localhost, port 1433 has failed. 连接到指定数据源时出错:与主机localhost,端口1433的TCP / IP连接失败。 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.". 错误:“连接被拒绝:连接。请验证连接属性。请确保主机上正在运行SQL Server实例并在端口上接受TCP / IP连接。请确保防火墙未阻止与端口的TCP连接”。

My connection string is this: 我的连接字符串是这样的:

jdbc:sqlserver://localhost\SRVR_SQL:1433;DatabaseName=spotfire_server    

I've also tried this: 我也尝试过这个:

jdbc:sqlserver://10.10.60.12\SRVR_SQL:1433;DatabaseName=spotfire_server    

and this: 和这个:

jdbc:sqlserver://localhost:1433;DatabaseName=spotfire_server   

and this: 和这个:

jdbc:sqlserver://SRVR_SQL:1433;DatabaseName=spotfire_server   

but all of them give the same error 但他们都给出了相同的错误

尝试10.0.0.2确保基本内容,例如数据库密码,名称,表名称.....

Read the error: 读取错误:

Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. 确保主机上正在运行SQL Server实例并在端口上接受TCP / IP连接。 Make sure that TCP connections to the port are not blocked by a firewall. 确保与端口的TCP连接没有被防火墙阻止。

Are you sure SQL Server is running locally? 您确定SQL Server在本地运行吗? Can you connect to it via SQL Server Admin tools? 您可以通过SQL Server Admin工具连接到它吗?

Which JDBC driver are you using - Microsoft or jDTS? 您正在使用哪个JDBC驱动程序-Microsoft或jDTS?

Try this URL, assuming the listener is running on 10.10.60.12, the port is 1433, and the schema name is dbName: 尝试以下URL,假设侦听器在10.10.60.12上运行,端口为1433,架构名称为dbName:

jdbc:sqlserver://10.10.60.12:1433;DatabaseName=dbName

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

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