开发者

Java DatabaseMetaData

I am starter and i want to know how to find a specific column is a FOREIGN KEY column in the database.

what i am doing is.....

I am getting a connection object from a specific data source. Using this connection ob开发者_C百科ject i am trying to get all the metadata of that specific datasource using DatabaseMetadata. I worked on getColumns, getPrimarykeys etc. But now i know what the tablename is what the column name is in that specific table. I want to know is that column a FORIGEN KEY column are not.

For example if i know column name i can know if that column is a PRIMARY KEY column are not in the same way i need it for a FOREGIN KEY.

Can some one help me in this

Thanks Kumar


have a look at the getExportedKeys and getImportedKeys methods. They should tell you what you want to know in a round about way...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜