db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Leroux <s...@wanadoo.fr>
Subject Re: Columns in index.
Date Mon, 26 Oct 2009 11:23:03 GMT
Hi Robin.

You may access those informations thought database meta data.
Here is, as an attachment, a snippet of code to do that.


Basically, it calls getMetaData(), then getIndexInfo() to obtain info for all 
indexes on a given table:
	DatabaseMetaData dbmd = conn.getMetaData();
	ResultSet rs = dbmd.getIndexInfo(null, "APP", "TBL", false, false);

The resulting ResultSet contains all the relevant informations. For your needs, 
I think the most interesting columns will be INDEX_NAME, ORDINAL_POSITION and 
COLUMN_NAME.


Hope this helps,
Sylvain


Robin Bale a écrit :
> 
> Hello All,
> 
> Somebody has given me a Derby database with some unknown indexes in. I can
> work out the names of all the indexes on this database, but I would like to
> know the names of the columns which make up the indexes.
> 
> Does anybody have any ideas?
> 
> Thanks in advance,
> 
> Robin Bale
> 
> 


-- 
Website: http://www.chicoree.fr

Mime
View raw message