No es muy elegante, pero puedes construir un String con los valores puestos explicitamente para el log, differente de la sentencia sql que se ejecuta, por ejemplo:
Código Java:
Ver originalsql = "UPDATE Flight_Pilot SET FLIGHT_PILOT_TYPE_ID = ?, COMMENTS = ?"
+ " WHERE FLIGHT_ID = ? AND PILOT_ID = ?";
sqlFullText = "UPDATE Flight_Pilot "
+ " SET FLIGHT_PILOT_TYPE_ID = " + this.flight_pilot_type_id
+ ", COMMENTS = " + this.comments
+ " WHERE FLIGHT_ID = " + this.flight_id
+ " AND PILOT_ID = " + this.pilot_id
+ ";";
pStat = dbConn.prepareStatement(sql);
pStat.setBigDecimal( 1, this.flight_pilot_type_id);
pStat.setString( 2, this.comments);
pStat.setBigDecimal( 3, this.flight_id);
pStat.setBigDecimal( 4, this.pilot_id);
System.
out.
println("Executing SQL: " + sqlFullText
); sqlRowCount = pStat.executeUpdate();
System.
out.
println("sqlRowCount = " + sqlRowCount
);
Howard Hyde, autor, 'Java Web Database Application Development' a: [URL="http://javawebdb.com"]http://javawebdb.com[/URL].