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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:04:55+00:00 2026-06-19T00:04:55+00:00

I want to connect to sql server express. I downloaded this driver. I read

  • 0

I want to connect to sql server express.
I downloaded this driver.
I read the help file and this is my code:

        try 
        {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            String connectionUrl = "jdbc:sqlserver://localhost;database=ActorsDb;integratedSecurity=true;";
            Connection con = DriverManager.getConnection(connectionUrl);
            PreparedStatement st = con.prepareStatement("INSERT INTO Actors(FirstName,LastName,Age) VALUES(?,?,?)");
            st.setString(1, "Robert");
            st.setString(2, "de Niro");
            st.setInt(3,45);
            st.executeUpdate();     
            con.close();
        } 
        catch (SQLException | ClassNotFoundException e) 
        {
            e.printStackTrace();
        }   

I get this 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 turned off firewall but nothing changed.

  1. I went to SQL Server Configuration Manager and i enabled TCP/IP

  2. I went to IP Adresses, IP1 and set the properties

Active:Yes ; Enabled:Yes ; TCP Dynamic Ports:[empty] ; TCP Port:1433

Any tips of what i am missing?
Thanks.

  • 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-19T00:04:56+00:00Added an answer on June 19, 2026 at 12:04 am

    Problem solved. I had to copy sqljdbc_auth.dll in the working directory.

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

Sidebar

Related Questions

In my application I want to connect SQL Server Express with Hibernate. But I
I'm new to .net and c# and want to connect Sql server express available
Using VB6, SQL Server 2000 I want to connect to others system database. Code:
I want to connect from home using SQL Server 2005 to another PC. I
I want to connect to DB2 from excel macro...This is my code, but it
I can connect to remote SQL Server database and I want to create a
to create new a new databse file start sql server management studio express on
I want to connect to Sql server and running some sql queries. How can
Is it possible to connect to SQL server in iPhone?. I want to create
I want to use the SqlDatasource to connect a SQL Server 2008, but it

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.