According to the DatabaseMetaData.getColumns
JavaDoc from Java 7, this information is returned in the column IS_GENERATEDCOLUMN
with either value YES
, NO
or empty string (which means: unknown).
This column was added in JDBC 4.0, and as far as I know the jTDS driver only implements JDBC 3.0. If this column does not exist in the ResultSet with jTDS, then your options are either to switch to the Microsoft SQL Server JDBC driver (I assume their driver does support this column), or query the system views of SQL Server yourself using something like (for column ID
in table C_Currencies
):
SELECT is_computed
FROM sys.tables t
INNER JOIN sys.columns c
ON c.object_id = t.object_id
WHERE t.name = 'C_Currencies'
AND c.name = 'ID'