title: Log4J JDBCAppender exception with MS SQL Server
body: <p>I use the following code to get a DB logger that uses log4j.</p>
  
  <pre><code>            PatternLayout layout = new PatternLayout();
  
              JDBCAppender jdbcAppender = new JDBCAppender();
              jdbcAppender.setDriver(jdbc);
              jdbcAppender.setUser(user);
              jdbcAppender.setPassword(password);
              jdbcAppender.setURL(url);
              jdbcAppender
                      .setSql("INSERT INTO " + logTable + " VALUES('%x', '%d', '%C', '%p', '%m')");
              jdbcAppender.setLayout(layout);
              jdbcAppender.activateOptions();
  
              Logger rootLogger = Logger.getRootLogger();
              rootLogger.setLevel(Level.DEBUG);
              rootLogger.addAppender(jdbcAppender);
  
              Logger logger = Logger.getLogger(type);
  </code></pre>
  
  <p>Logging throws exceptions:
  <code>logger.info("This is log");</code></p>
  
  <pre><code>log4j:ERROR Failed to excute sql
  java.sql.SQLException: Incorrect syntax near the keyword 'is'.
      at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
      at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
      at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
      at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
      at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613)
      at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572)
      at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:809)
      at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1288)
      at net.sourceforge.jtds.jdbc.JtdsStatement.executeUpdate(JtdsStatement.java:1241)
      at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:218)
      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 com.nirvasoft.logging.Main.main(Main.java:20)
  </code></pre>
  
  <p>What might be causing the error?</p>