I think using PreparedStatement might work:
PreparedStatement stmt = connection.prepareStatement("select ..."); ResultSetMetaData meta = stmt.getMetaData(); for (int col=0; col < meta.getColumnCount(); col++) { System.out.println("Column: " + meta.getColumnName(col + 1)); }
(Edit): I tried this with Oracle 11.2 and driver version 11.2.0.3, and it works.
If this fails, you can simply add where 1=0 to the request and execute it. At the very least, it will not return all rows then (possibly also using Statement.setMaxRows() , just to be sure.
The last (but rather complicated) option would be to use dbms_sql to open, prepare and describe the instruction. See the manual for more details: http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_sql.htm
a_horse_with_no_name
source share