[Microsoft][ODBC SQL Server Driver]無效的敘述元索引

Rate this post

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

本站部分內容包含聯盟行銷連結。當您透過連結購買商品或服務時,本站將獲得微薄的佣金,這並不會影響您的購買價格,但能支持本站的運作,感謝您的支持。問題詢問

點我分享到Facebook

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *