public String formatSQL(Object obj,Object expr){
  String sql=null;
  if (expr instanceof String) {
    sql=(String)expr;
    if (log.isLoggable(Level.FINEST)) {
      log.finest("SQL retrieved from state = " + sql);
    }
  }
 else   if (obj != null) {
    sql=toString(obj);
    if (sql != null) {
      if (sql.startsWith("prep")) {
        sql=sql.replaceFirst("prep[0-9]*: ","");
      }
      sql=sql.replaceAll("X'.*'",BINARY_SQL_MARKER);
    }
    if (log.isLoggable(Level.FINEST)) {
      log.finest("SQL derived from context = " + sql);
    }
  }
  return sql;
}

public String formatSQL ( Object obj , Object expr ) { String sql = null ; if ( expr instanceof String ) { sql = ( String ) expr ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "SQL retrieved from state = " + sql ) ; } } else if ( obj != null ) { sql = toString ( obj ) ; if ( sql != null ) { if ( sql . startsWith ( "prep" ) ) { sql = sql . replaceFirst ( "prep[0-9]*: " , "" ) ; } sql = sql . replaceAll ( "X'.*'" , BINARY_SQL_MARKER ) ; } if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "SQL derived from context = " + sql ) ; } } return sql ; }
this method attempts to return a sql statement . if an expression is supplied , and is string , it will be used . otherwise the method will attempt to derive an expression from the supplied object .
