title: log4j not initializes JDBC driver
body: <p>Trying to use log4j to log to MS SQL server:</p>
  
  <pre><code>import org.apache.log4j.Logger;
  
  public class MailTest {
    private static Logger lg = Logger.getLogger(MailTest.class);
    public static void main(String[] args) {
        MailTest test = new MailTest();
        try {
  
            lg.info("hello");
  
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
  
    }
  </code></pre>
  
  <p>Got exception:</p>
  
  <pre><code>log4j:ERROR Failed to excute sql
  java.sql.SQLException: No suitable driver found for "jdbc:sqlserver://localhost:1433;databaseName=ERP_IDMS"
      at java.sql.DriverManager.getConnection(DriverManager.java:689)
      at java.sql.DriverManager.getConnection(DriverManager.java:247)
      at org.apache.log4j.jdbc.JDBCAppender.getConnection(JDBCAppender.java:251)
      at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:215)
      at org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:289)
      at org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:186)
      at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
      at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
      at org.apache.log4j.Category.callAppenders(Category.java:206)
      at org.apache.log4j.Category.forcedLog(Category.java:391)
      at org.apache.log4j.Category.info(Category.java:666)
      at tst.MailTest.main(MailTest.java:35)
  d{yyyy-MM-dd HH:mm:ss} INFO  MailTest:35 - hello
  </code></pre>
  
  <p>log4j.properties:</p>
  
  <pre><code># Define the root logger with file appender
  log4j.rootLogger = debug, sql, stdout
  #log4j.rootLogger = error, sql, stdout
  
  # Log for the Hibernate
  log4j.logger.org.hibernate=ERROR
  #log4j.logger.org.hibernate=INFO
  #log4j.logger.org.hibernate.type=trace
  #log4j.logger.org.hibernate.type=ALL
  
  # ================ Added as part of logging into DB ====================
  # Define the jdbc appender
  log4j.appender.sql=org.apache.log4j.jdbc.JDBCAppender
  log4j.appender.sql.URL="jdbc:sqlserver://localhost:1433;databaseName=ERP_IDMS"
  
  
  # Set Database Driver
  log4j.appender.sql.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
  
  # Set database user name and password
  log4j.appender.sql.user=sa
  log4j.appender.sql.password=sa
  
  # Set the SQL statement to be executed.
  #short
  log4j.appender.sql.layout.ConversionPattern=INSERT INTO LOGS1 VALUES ('%d{yyyy-MM-dd  HH:mm:ss.SSS}' ,'%C','%p','%m', '%throwable{short}', '%throwable{800}')
  # Define the xml layout for file appender
  log4j.appender.sql.layout=org.apache.log4j.EnhancedPatternLayout
  #=======================================================================
  
  # Direct to stdout
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.Target=System.out
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
  
  # =============================================================================
  </code></pre>
  
  <p>I have seen many reports on internet regardin JDBC is not initialized. But how to do this in log4j? How to fix this error? </p>