更新时间:2022-05-30 23:00:24
我找到了符合条件的解决方案
I found a solution with the condition
metaData.getColumnType(columnNumber) == 12
如果满足此条件,则执行查询
if this condition is satisfied, execute the query
SELECT System_Type_Id FROM Sys.Columns WHERE Name = [column name] AND Object_Id = (SELECT Object_Id FROM Sys.Tables WHERE Name = [table name])
对于smalldatetime
,它将返回58
,对于datetime
,它将返回61
.