code: public MjdbcSQLException convert(Connection conn, SQLException cause, String sql, Object... params) {
          AssertUtils.assertNotNull(cause);
  
          String causeMessage = cause.getMessage();
          if (causeMessage == null) {
              causeMessage = "";
          }
          StringBuffer msg = new StringBuffer(causeMessage);
  
          msg.append(" Query: ");
          msg.append(sql);
          msg.append(" Parameters: ");
  
          if (params == null) {
              msg.append("[]");
          } else {
              msg.append(Arrays.deepToString(params));
          }
  
          MjdbcSQLException convertedException = null;
  
          try {
              // trying to use JDBC4 exceptions and convert them into Spring SQL Exceptions
              convertedException = translateJDBC4Exception(msg.toString(), cause.getSQLState(),
                      cause.getErrorCode(), cause);
          } catch (MjdbcException ex) {
              // possible as JDBC4 classes might not be available if we are running it with Java 5
          }
  
          if (convertedException == null) {
              // JDBC4 exceptions are not available. Trying to read SQL state prefix and convert it to Spring SQL Exceptions
              convertedException = translateSQLStatePrefix(msg.toString(), cause.getSQLState(),
                      cause.getErrorCode(), cause);
          }
  
          if (convertedException == null) {
              // JDBC4 and SQL state prefix failed to translate. Using database specific translation
              convertedException = translate(msg.toString(), cause.getSQLState(),
                      cause.getErrorCode(), cause);
          }
  
          if (convertedException == null) {
              // wasn't able to translate. Creating general exception...
              convertedException = new MjdbcSQLException(msg.toString(), cause.getSQLState(),
                      cause.getErrorCode());
          }
  
          convertedException.setStackTrace(cause.getStackTrace());
  
          return convertedException;
      }
docs: {@inheritDoc}