title: Connection Between Java App and Sql Server EXPR 2008 R2 Not Established
body: <p>I'm newbie with SQL Server , i'm trying to connect my java Application to SQL Server, actually i get the JDBC jar file for MSSQL Driver from <a href="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=11774" rel="nofollow">Microsoft Offical website</a>
  then as showing in my <a href="http://i.stack.imgur.com/4bHOz.png" rel="nofollow">Screenshot Here*</a> the SQL Server Driver was imported well, but m problem i faced that i got this Exception while i pretty sure that i did the required steps well.</p>
  
  <h1>Error output :</h1>
  
  <pre><code>run:
  Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:TOSHIBA-PC;database=xxx;user=sa@TOSHIBA-PC;password=shiner151092;encrypt=true;trustServerCertificate=false;loginTimeout=30;
      at java.sql.DriverManager.getConnection(DriverManager.java:689)
      at java.sql.DriverManager.getConnection(DriverManager.java:270)
      at connect.main(connect.java:18)
  C:\Users\toshiba\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
  BUILD FAILED (total time: 0 seconds)
  </code></pre>
  
  <blockquote>
    <p>where is the Problem and how could i solve it?</p>
    
    <p><strong>Class connect's code</strong>:</p>
  </blockquote>
  
  <pre><code>import java.math.BigDecimal;
  import java.sql.*;
  import java.time.LocalDate;
  
  public class connect {
  
      public static void main(String[] args) throws SQLException {
          String connectionString =
              "jdbc:sqlserver://TOSHIBA-PC;"
              + "database=xxx;"
              + "user=sa@TOSHIBA-PC;"
              + "password=shiner151092;"
              + "encrypt=true;"
              + "trustServerCertificate=false;"
              + "loginTimeout=30;";
  
          try (Connection connection = DriverManager.getConnection(connectionString)) {
  
  
              String selectSql = "SELECT * from Table_111";
              try (Statement statement = connection.createStatement();
                  ResultSet resultSet = statement.executeQuery(selectSql)) {
  
                              if(resultSet != null){
                                  System.out.println("connection goes right !!!");
                              }
              }
          }
      }
  }
  </code></pre>