title: Connecting a Java application to an SQL database with Eclipse
body: <p>I know this has been asked before but I really can't get this to work and as far as I can see I've followed all the steps.</p>
  
  <p>I'm using Eclipse.</p>
  
  <p>So I downloaded the Microsoft SQL Driver sqljdbc v4.0. 
  I created a new project and class. I edited the build path by adding the .jar file to the libraries.</p>
  
  <p>I typed the following code:</p>
  
  <pre><code>package com.test.sql;
  import java.sql.*;
  public class Connect
  {
  public static void main (String[]args)
  {
      Connection con = null;
      String conURL = "jdbc:sqlserver://localhost; databaseName=AnotherTestDB;";
      try
      {
          con = DriverManager.getConnection(conURL);
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I got the following error:</p>
  
  <pre><code>java.sql.SQLException: No suitable driver found for jdbc:sqlserver://localhost; databaseName=AnotherTestDB;
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at com.test.sql.Connect.main(Connect.java:11)
  </code></pre>
  
  <p>A bit more research and I was told put it in the java /lib/ext and reference it from there. </p>
  
  <p>Nothing changed.  </p>
  
  <p>Any help? </p>
  
  <p>Thanks.</p>