title: Class.forName in SQL server
body: <p>I am using SQL server 2008 as a Database. And using <b>JDBC</b>, I am accessing the DB as Under.</p>
  
  <pre><code>public class DBConn {
  public static void main(String[] args) throws ClassNotFoundException, SQLException{
  
      Connection con =null;
      //Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
      con = DriverManager.getConnection("jdbc:sqlserver://BG4WS0552:1433;databaseName=DynamicsAx2009",
              "TESTUSER", "Sonata@123");
      Statement stmt = con.createStatement();
      String query = "SELECT * FROM custtable";
      DatabaseMetaData dmd = con.getMetaData();
      ResultSet rs = dmd.getColumns ("DynamicsAx2009", "%", "custtable", null) ;
      ResultSetMetaData rsmd = rs.getMetaData();
      int i = 1;
      while (rs.next()) {
          System.out.print(i++ + " COLUMN_NAME is " + rs.getString("COLUMN_NAME"));
          System.out.print(" TYPE:" + rs.getString("TYPE_NAME"));
  
          System.out.println("  DATA_TYPE is " + rs.getString("DATA_TYPE"));
      }
  }}
  </code></pre>
  
  <p>See in above code, i have commented out that Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"). Even though my program is running fine. Please let me know how it is working without registering the driver.</p>