Bryan Pendleton <[email protected]> writes:

>> What root canal.... Just to get column names of an index....
>
> I always just use ij's "show indexes" command.
>
> http://db.apache.org/derby/docs/10.8/tools/rtoolsijcomrefshow.html

Alternatively, from a Java application, this information can be
retrieved by a calling DatabaseMetaData.getIndexInfo().
http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getIndexInfo%28java.lang.String,%20java.lang.String,%20java.lang.String,%20boolean,%20boolean%29

Something along these lines would print all the indexed columns in the
table T1 in schema S, and the name of the indexes:

    ResultSet rs = conn.getMetaData().getIndexInfo(null, "S", "T1", false, 
false);
    while (rs.next()) {
        System.out.println(rs.getString("INDEX_NAME") + ": " + 
rs.getString("COLUMN_NAME"));
    }

Hope this helps,

-- 
Knut Anders

Reply via email to