Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to get a SQL-Server connection
    primarykey
    data
    text
    <p>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: <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=21599" rel="nofollow">Microsoft download page</a></p> <p>I use the following code: </p> <pre><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"); } } </code></pre> <p>Now this piece of code runs on my developers machine, im getting the following results: </p> <blockquote> <p>connecting to: jdbc:sqlserver://<strong><em>.</em></strong>.<strong><em>.</em></strong>:1433;DatabaseName=******</p> <p>succesfully connected</p> </blockquote> <p>But when i run this piece of code on my developers machine it prints the follwing: </p> <blockquote> <p>connecting to: jdbc:sqlserver://10.31.3.3:1433;DatabaseName=*******</p> </blockquote> <p>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?</p> <p>Hope anyone here can help me with this annoying problem!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload