As a SQL statement passed through a JDBC driver - I don't know how you could do that. However, a possible workaround might be to have a generic procedure on the database side. You could then put in a call to the procedure and get the number of rows affected passed back to you:
PROCEDURE generic_call(p_command IN VARCHAR2, p_rows IN OUT NUMBER) IS
BEGIN
EXECUTE IMMEDIATE p_command;
p_rows := sql%rowcount;
END;
Now, instead of issuing a sql command, your application would declare a variable (rows_affected), and place a call:
generic_call('delete from TABLE where id=502',rows_affected)
After the call completes, you can examin rows_affected to see how many rows were updated/deleted.
It's a bit klugey (as most work-arounds are!) and it may or may not work for you. But it's about the best I can do today!