這是ㄚ琪在用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的陣列那樣可以自由使用。沒有仔細看手冊,就很容易像沒有羅盤那樣迷失方向,切記謹慎。