Imagine I have a query like
SELECT * from table1 a, table2 b where (WHATEVER)
Maybe both tables have the same column name. So I though it
ResultSetMetadata.getColumnLabel() is what you need
(edit) sample example, as stated by bharal in comment
SELECT * from table1 a, table2 b where (WHATEVER) ResultSetMetaData rsmd = rset.getMetaData(); rsmd.getColumnLabel(1);