title: jdbc sql server error: java.sql.SQLException: No suitable driver
body: <p>I'm using eclipse, trying to connect to a sql server db. I have the jars in my build path. I get the error: </p>
  
  <blockquote>
    <p>java.sql.SQLException: No suitable
    driver    at
    java.sql.DriverManager.getConnection(DriverManager.java:325)
      at
    java.sql.DriverManager.getConnection(DriverManager.java:353)</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>  import java.sql.Connection;
      import java.sql.DriverManager;
      import java.sql.ResultSet;
      import java.sql.Statement;
  
      public class connect
      {
         public void dbConnect(String db_connect_string,
                  String db_userid,
                  String db_password)
         {
            try {
               Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
               Connection conn = DriverManager.getConnection(db_connect_string,
                        db_userid, db_password);
               System.out.println("connected");
               Statement statement = conn.createStatement();
               String queryString = "select * from sysobjects where type='u'";
               ResultSet rs = statement.executeQuery(queryString);
               while (rs.next()) {
                  System.out.println(rs.getString(1));
               }
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
  
         public static void main(String[] args)
         {
            connect connServer = new connect();
            connServer.dbConnect("jdbc:jtds:sqlserver://ssdd.ffd.aduat.fdd.com:5150", "rre",
                     "wer");
         }
      }
  </code></pre>