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 7758775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:27:08+00:00 2026-06-01T13:27:08+00:00

I know that this is a repeated question. I have found very similar questions

  • 0

I know that this is a repeated question. I have found very similar questions and solutions to them but still i’m struck with it.

I’m using eclipse to connect my java application with microsoft sql server 2008 database. Following is my code

    import java.sql.*;
public class ConnectionTest2 {
  public static void main(String [] args) {
    try {
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String connectionUrl = "jdbc:sqlserver://localhost:1433;databaseName=Sample;integratedSecurity=true";
        Connection con = DriverManager.getConnection(connectionUrl,"","");
        System.out.println("Connected");
        } catch (SQLException e) {
            System.out.println("SQL Exception: "+ e.toString());
        } 
catch (ClassNotFoundException cE) {
            System.out.println("Class Not Found Exception: "+ cE.toString());
        }
  }
}

I’ve enabled the tcp/ip and VIA by going in to sql server configuration manager and set the port number to 1433 under IPALL.

I’ve tried in many ways but i’m unable to find a solution to the following error

SQL Exception: com.microsoft.sqlserver.jdbc.SQLServerException: The
TCP/IP connection to the host localhost, 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.”.

I’ve also disabled the windows firewall but failed to connect.

Please help me out.

  • 1 1 Answer
  • 3 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-01T13:27:10+00:00Added an answer on June 1, 2026 at 1:27 pm

    It is what it says: connection is refused. Have you tried ‘telnet 1433’?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this sort of question has been asked here before, but still
I know that this Question is repeated but I can't find the answer in
I know that this question must have been asked and answered a million times,
I know that this is a newbie question but I am a newbie so
Sorry I know similar question have been asked many times before but like most
I know, this is again a repeated question but my case it is different
I know that this question has been asked previously, but before you give me
Sorry if this is a repeated question but I have been looking for the
this is a very specific question, but i also have very specific details on
I know that this question had already been asked a couple of times before,

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.