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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:49:20+00:00 2026-05-30T18:49:20+00:00

Im having difficulties trying to get a connection to my sqlserver database. The database

  • 0

Im having difficulties trying to get a connection to my sqlserver database.
The database im using is SQL-Server 2008.
The driver im using is the one i got here: Microsoft download page

I use the following code:

public static final String URL_FORMAT = "jdbc:sqlserver://%s:%s;DatabaseName=%s";

    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        String connectionURL = String.format(URL_FORMAT, "10.31.3.3", 1433, "EPowerTest");
        System.out.println("connecting to: "+connectionURL);
        
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        Connection connection = DriverManager.getConnection(connectionURL, "sa", "*************");
        if (connection == null) {
            System.out.println("no connection was established");
        } else {
            System.out.println("succesfully connected");
        }
    }

Now this piece of code runs on my developers machine, im getting the following results:

connecting to: jdbc:sqlserver://...:1433;DatabaseName=******

succesfully connected

But when i run this piece of code on my developers machine it prints the follwing:

connecting to: jdbc:sqlserver://10.31.3.3:1433;DatabaseName=*******

and the second line never gets printed, because it seems DriverManager.getConnection does not return. This is not a firewall issue, since all three terminals (db server, developers machine and the test machine) are all on the same network. Why is my method not returning? am i missing some important SQLServer files?

Hope anyone here can help me with this annoying problem!

  • 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-30T18:49:21+00:00Added an answer on May 30, 2026 at 6:49 pm

    Check if the JVM in the machine that the connections hangs is the version 1.6.0_29. If it is, upgrade to a newer Java.

    Here is another link explaining the issue.

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

Sidebar

Related Questions

I am having difficulties when trying to insert files into a SQL Server database.
I'm trying to get an insert to work using LINQ and am having some
I'm having a little difficulties while trying to get a certain layout to work:
I'm trying to get the following query to function but I'm having difficulties with
I am having difficulties trying to solve a runtime error that I get in
I'm trying to start using LINQ and specifically LINQ to SQL but I'm having
I'm trying to print a file using straight HTML, however, I am having difficulties
i'm trying to set up the selenium-maven-plugin and having some difficulties i hope somebody
I'm having difficulties removing the lineStyle lines in JTrees using Netbeans. In a standalone
I'm having difficulties getting XslCompiledTransform.Load method to take a server path. I googled around

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.