It doesn't really matter. The hit to the database will be many many times slower than accessing the column values.
rs.getString(n)
will be negligibly faster. However, it's going to depend on the driver implementation and number of columns in the result. Most implementations will likely use a HashMap to map column names to an index, but not necessarily. Also, some drivers may build the HashMap lazily which means the first row will be the slowest to access by column name. JTDS, as an example, does a linear search for columns not yet in its HashMap.
EDIT: minor edits and rearranged. No content change.