这是ㄚ琪在用Java使用JDBC透过ODBC来读取MS SQL SERVER的资料库结构时,使用getColumns来读取资料表的结构,输出会有这些资料:
The output is captured in a ResultSet object with the following fields:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- DATA_TYPE int => SQL type from java.sql.Types
- TYPE_NAME String => Data source dependent type name, for a UDT the type name is fully qualified
- COLUMN_SIZE int => column size.
- DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where DECIMAL_DIGITS is not applicable.
- NULLABLE int => is NULL allowed.
注意:这些资料的读取是有顺序的,它可不像PHP的阵列那样可以自由使用。没有仔细看手册,就很容易像没有罗盘那样迷失方向,切记谨慎。