Error:The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

前端 未结 1 1304
故里飘歌
故里飘歌 2020-12-16 08:16

I am using

  • Windows 7
  • Netbeans IDE 7.1.2
  • SQL Server Management Studio Express 2005
  • JDK1.6

I am getting the below

相关标签:
1条回答
  • 2020-12-16 08:43

    I followed the steps below to successfully connect to an SQLExpress instance using JDBC:

    1. Configure TCP/IP communication with SQL Express
      1. Open SQL Server Configuration Manager.
      2. Go to SQL Server Network Configuration -> Protocols for SQLEXPRESS
      3. Set the status of TCP/IP protocol to "Enabled" (if it is already not).
      4. Open Properties window for TCP/IP, go to IP Addresses section.
      5. Go to the bottom of this property page and set the TCP Port under IPAll to 1433.
    2. Connect to the SQLExpress instance using Microsoft's JDBC driver for SQL Server
      1. JDBC URL: jdbc:sqlserver://localhost;instance=SQLEXPRESS;databaseName=<your DB>;user=<your User>;password=<your Passwd>
    0 讨论(0)
提交回复
热议问题