在 Apache Derby 中描述 table 以获取 table 的主键

Describe table to get the primary key for a table in Apache Derby

我正在使用 Apache Derby 10.14.2。我需要知道 table 的主键。当我对table进行Describe时,只得到如下指令。 derby system tables for the column of primary key info 没有答案。

ij> create table id ( id int primary key, name varchar(10));
ij> describe id; 

COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
ID                  |INTEGER  |0   |10  |10    |NULL      |NULL      |YES     
NAME                |VARCHAR  |NULL|NULL|10    |NULL      |20        |YES

这里没有给出主键的信息。在 Apache Derby 中获取 table 的主键的查询是什么?

在程序中,使用DatabaseMetaData.getPrimaryKeys()

或者,如果您想 运行 直接查询 Derby 系统目录,您可以阅读 this related question.

的答案