title: jdbc connection fails while running the program from jar file
body: <p>I've got an application, where I use a JDBC connection. When I run it from the Eclipse environment, there's no problem with anything, neither with connection.
  But, when I pack it into executable jar file, and run it from command line, while calling the line</p>
  
  <pre><code>DriverManager.getConnection(url, user, password);
  </code></pre>
  
  <p>with correct credentials, the application gets frozen. (With wrong login attempt everything is ok - the SQLServerException is thrown).
  I tried to create the jar file with different library choices, but the result is the same.</p>
  
  <p>Can anyone help?</p>
  
  <p>I use sqljdbc4.jar library</p>
  
  <p>Constructor of my Database class:</p>
  
  <pre><code>public Database(String url, String user, String password) throws SQLException, ClassNotFoundException {
      Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  
      System.out.println("forname");
      connection = DriverManager.getConnection(url, user, password);
      System.out.println("get connection");
  }
  </code></pre>
  
  <p>After correct login no Exception is thrown and "get connection" string is not printed out (only "forname" string is printed)</p>