if(log.isDebugEnabled()) {
if(log.isErrorEnabled()) {
    protected ResultSet executeQuery(PreparedStatement pstmt, String query) throws SQLException {        if (query == null) throw new IllegalArgumentException("executeUpdate: null query");        try {            long startTime = 0;            if (pwlog != null)                startTime = System.currentTimeMillis();            ResultSet result = pstmt.executeQuery();            if (pwlog != null) {                long endTime = System.currentTimeMillis();                pwlog.println((endTime - startTime) + " " + query);            }            return result;        } catch (SQLException sqle) {          if(log.isDebugEnabled()) {            log.error("SQLException query: " + query);          }            if (pwlog != null) {                pwlog.println("SQLException query: " + query);                pwlog.flush();            }            throw sqle;        }    }