Java SQLException logSqlError(SQLException ex, Logger logger)

Here you can find the source of logSqlError(SQLException ex, Logger logger)

Description

log Sql Error

License

Open Source License

Declaration

public static void logSqlError(SQLException ex, Logger logger) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.sql.SQLException;

import org.apache.log4j.Logger;

public class Main {

    public static void logSqlError(SQLException ex, Logger logger) {
        System.out.printf(//from  ww w.java  2s.  co m
                "DBERROR OCCURS: \n CODE-%d\n STATE: %s  MESSAGE: %s",
                +ex.getErrorCode(), ex.getSQLState(), ex.getMessage());
    }
}

Related

  1. isTransient(SQLException e)
  2. isXJ015Error(Throwable exception)
  3. log(Logger logger, SQLException e)
  4. log(SQLException e, Logger log)
  5. logAll(Log log, SQLException e)
  6. mergeException(List exceptions)
  7. mergeException(List exceptions)
  8. mergeSQLExceptionMsg(final StringBuilder msgBuilder, final SQLException e, final String prefix)
  9. oracleSessionHasBeenKilled(Exception exception)