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

  • Home
  • SEARCH
  • 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 4582520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:05:10+00:00 2026-05-21T21:05:10+00:00

I have downloaded JDK 6 and also I have sqljdb4.jar and I have database.properties

  • 0

I have downloaded JDK 6 and also I have sqljdb4.jar and I have database.properties file that content the following data

database.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
database.url=jdbc:sqlserver://.;databaseName=UserInfo;integratedSecurity=true; 
database.username=sa
database.password=admin

B.N : I’m installing the server on my machine and the server name = . , also I’m using Windows Authontication

My problem now is when I try to create connection I have the following error

com.microsoft.sqlserver.jdbc.SQLServerException:
The TCP/IP connection to the host
localhost, port 1433 has failed.
Error: Connection refused: connect.
Please verify the connection
properties and check that a SQL Server
instance is running on the host and
accepting TCP/IP connections at the
port, and that no firewall is blocking
TCP connections to the port. at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)

I don’t know what is the exact problem here

If any one can help I will be appreciated

Thanks in Advance

  • 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-05-21T21:05:11+00:00Added an answer on May 21, 2026 at 9:05 pm

    That’s caused by many probabilities like
    1- IP is worong
    2- Port is wrong
    3- There is firewall prevent machine to go out and connect to another IP
    4- SQL server down .

    try to use

        public class JdbcSQLServerDriverUrlExample
    {
      public static void main(String[] args)
      {
        Connection connection = null;
        try
        {
          // the sql server driver string
          Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    
          // the sql server url
          String url = "jdbc:microsoft:sqlserver://HOST:1433;DatabaseName=DATABASE";
    
          // get the sql server database connection
          connection = DriverManager.getConnection(url,"THE_USER", "THE_PASSWORD");
    
          // now do whatever you want to do with the connection
          // ...
    
        }
        catch (ClassNotFoundException e)
        {
          e.printStackTrace();
          System.exit(1);
        }
        catch (SQLException e)
        {
          e.printStackTrace();
          System.exit(2);
        }
      }
    }
    

    What i need to explain is there is very good technology called ” Persistence ” is better than JDBC and is more than brilliant and easy to use .

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

Sidebar

Related Questions

I have downloaded a file WINDOWS POWERSHELL that has an .msu extension how do
The jar command is not working on my box. I have downloaded the jdk,
I have downloaded a Java 3d-1_5_1-macosx.zip. I am trying unzip the file. The file
I have downloaded ffmpeg lib file and complied it for armv7. I added ffmpeg
I downloaded eclipse helios. I have jdk 1.6 installed. I am not getting dynamic
I have downloaded the java JDK but I am unable to run the program.
Can anyone help? i have downloaded the jdk docs (7) to my pc and
I have extracted a .class file from the rt.jar file in jre1.7, and have
have downloaded page by webbrowser and need to get mail address. But it is
I have downloaded the two releases of python 2.6.8 from here http://www.python.org/getit/releases/2.6.8/ and I

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.