Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:13:22+00:00 2026-06-11T16:13:22+00:00

I am using Windows 7 Netbeans IDE 7.1.2 SQL Server Management Studio Express 2005

  • 0

I am using

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

I am getting the below error while connecting to the database:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

My connection string is:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");  
Connection connection = DriverManager.getConnection(  
    "jdbc:sqlserver://127.0.0.1:1433;databaseName=dbcm;" +  
    "user=sa;password=sa");

I’ve checked below things:

  1. In SQL Server Configuration Manager, Protocols for SQLEXPRESS : TCP/IP Enabled
    In fact I made enable remaining 3 too.
  2. SQL Server(SQLExpress) and SQL Browser Service both are running.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:13:23+00:00Added an answer on June 11, 2026 at 4:13 pm

    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
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Netbeans 6.7.1 on Windows. I created a Java application using Swing. When
I'm using NetBeans 6.8 on Windows 7. I upgraded from WinXP and NetBeans 6.7.
Using windows server, I have a path to a file that, when you click
I am using GNU/Linux (Ubuntu + Gnome). I have been using netbeans on windows
I am using Netbeans 6.8 version and Ruby 1.9.1 installed on Windows XP. I
I am currently using NetBeans IDE with Jython 2.5.1 When debugging my project step
While Doing clean and build i am getting following error. How to avoid this
i am having code which is using javax.comm lib file,i am getting error saying
I am trying to download NetBeans IDE 7.2. While Installing, the installer displays the
I'm using NetBeans 6.9.1 on windows and i am following along with a rather

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.