code: protected void rethrow(SQLException cause, String sql, Object[] params)
          throws SQLException {
  
          StringBuffer msg = new StringBuffer(cause.getMessage());
  
          msg.append(" Query: ");
          msg.append(sql);
          msg.append(" Parameters: ");
  
          if (params == null) {
              msg.append("[]");
          } else {
              msg.append(Arrays.asList(params));
          }
  
          SQLException e = new SQLException(msg.toString(), cause.getSQLState(),
                  cause.getErrorCode());
          e.setNextException(cause);
  
          throw e;
      }
docs: Throws a new exception with a more informative error message.
  
  @param cause The original exception that will be chained to the new
  exception when it's rethrown.
  
  @param sql The query that was executing when the exception happened.
  
  @param params The query replacement parameters; <code>null</code> is a
  valid value to pass in.
  
  @throws java.sql.SQLException if a database access error occurs