我正在使用 JTDS JDBC 驱动程序。版本是 1.2.4 假设我正在获取特定表的列元数据:
ResultSet columnsRs = meta.getColumns(null, [pattern], [table name], null);
while(columnRs.next()){
// I would like to know here if the current column is marked computed
}
这是 ID 计算字段的表定义
CREATE TABLE [dbo].[C_Currencies](
[CurrencyID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](150) NOT NULL,
[ID] AS ([CurrencyID]),
CONSTRAINT [pk_currency] PRIMARY KEY CLUSTERED
(
[CurrencyID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]