W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
public interface RowSetMetaData
extends ResultSetMetaData
包含有關(guān) RowSet 對象中的列的信息的對象。 此接口是 ResultSetMetaData 接口的擴(kuò)展,其中包含用于設(shè)置 RowSetMetaData 對象中的值的方法。 當(dāng) RowSetReader 對象將數(shù)據(jù)讀入 RowSet 對象時,它會創(chuàng)建一個 RowSetMetaData 對象并使用 RowSetMetaData 接口中的方法對其進(jìn)行初始化。 然后讀取器將 RowSetMetaData 對象傳遞給行集。
此接口中的方法在應(yīng)用程序調(diào)用方法 RowSet.execute 時在內(nèi)部調(diào)用; 應(yīng)用程序程序員不會直接使用它們。
Since:
1.4
從接口 java.sql.ResultSetMetaData 繼承的字段 |
---|
columnNoNulls, columnNullable, columnNullableUnknown |
修飾符和類型 | 方法 | 描述 |
---|---|---|
void | setAutoIncrement(int columnIndex, boolean property) | 設(shè)置指定列是否自動編號,默認(rèn)為 RowSet 對象的列不自動編號。 |
void | setCaseSensitive(int columnIndex, boolean property) | 設(shè)置指定列是否區(qū)分大小寫。 |
void | setCatalogName(int columnIndex, String catalogName) | 將指定列的表的目錄名稱(如果有)設(shè)置為給定的字符串。 |
void | setColumnCount(int columnCount) | 將 RowSet 對象中的列數(shù)設(shè)置為給定數(shù)。 |
void | setColumnDisplaySize(int columnIndex, int size) | 將指定列的正常最大寬度(以字符為單位)設(shè)置為給定的 int。 |
void | setColumnLabel(int columnIndex, String label) | 將建議的列標(biāo)題設(shè)置為用于打印輸出和顯示(如果有)給給定的字符串。 |
void | setColumnName(int columnIndex, String columnName) | 將指定列的名稱設(shè)置為給定的字符串。 |
void | setColumnType(int columnIndex, int SQLType) | 將指定列的 SQL 類型設(shè)置為給定的類型。 |
void | setColumnTypeName(int columnIndex, String typeName) | 將特定于數(shù)據(jù)源的指定列的類型名稱(如果有)設(shè)置為給定的字符串。 |
void | setCurrency(int columnIndex, boolean property) | 設(shè)置指定列是否為現(xiàn)金值。 |
void | setNullable(int columnIndex, int property) | 設(shè)置指定列的值是否可以設(shè)置為 NULL。 |
void | setPrecision(int columnIndex, int precision) | 將指定列的小數(shù)位數(shù)設(shè)置為給定的 int。 |
void | setScale(int columnIndex, int scale) | 將指定列的小數(shù)點右側(cè)的位數(shù)設(shè)置為給定的 int。 |
void | setSchemaName(int columnIndex, String schemaName) | 將指定列的表模式的名稱(如果有)設(shè)置為給定的字符串。 |
void | setSearchable(int columnIndex, boolean property) | 設(shè)置指定列是否可以在 where 子句中使用。 |
void | setSigned(int columnIndex, boolean property) | 設(shè)置指定列是否為有符號數(shù)。 |
void | setTableName(int columnIndex, String tableName) | 將指定列的表名(如果有)設(shè)置為給定的字符串。 |
從接口 java.sql.ResultSetMetaData 繼承的方法 |
---|
getCatalogName, getColumnClassName, getColumnCount, getColumnDisplaySize, getColumnLabel, getColumnName, getColumnType, getColumnTypeName, getPrecision, getScale, getSchemaName, getTableName, isAutoIncrement, isCaseSensitive, isCurrency, isDefinitelyWritable, isNullable, isReadOnly, isSearchable, isSigned, isWritable |
從接口 java.sql.Wrapper 繼承的方法 |
---|
isWrapperFor, unwrap |
void setColumnCount(int columnCount) throws SQLException
將 RowSet 對象中的列數(shù)設(shè)置為給定數(shù)。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnCount | RowSet 對象中的列數(shù) |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setAutoIncrement(int columnIndex, boolean property) throws SQLException
設(shè)置指定列是否自動編號,默認(rèn)為 RowSet 對象的列不自動編號。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
property | 如果列自動編號,則為 true; 如果不是,則為 false |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setCaseSensitive(int columnIndex, boolean property) throws SQLException
設(shè)置指定列是否區(qū)分大小寫。 默認(rèn)值為假。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
property | 如果該列區(qū)分大小寫,則為 true; 如果不是,則為 false |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setSearchable(int columnIndex, boolean property) throws SQLException
設(shè)置指定列是否可以在 where 子句中使用。 默認(rèn)值為假。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
property | 如果該列可以在 WHERE 子句中使用,則為 true; 如果不能,則為 false |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setCurrency(int columnIndex, boolean property) throws SQLException
設(shè)置指定列是否為現(xiàn)金值。 默認(rèn)值為 false。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
property | 如果該列是現(xiàn)金值,則為 true; 如果不是,則為 false |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setNullable(int columnIndex, int property) throws SQLException
設(shè)置指定列的值是否可以設(shè)置為 NULL。 默認(rèn)為 ResultSetMetaData.columnNullableUnknown
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
property | 以下常量之一:ResultSetMetaData.columnNoNulls、ResultSetMetaData.columnNullable 或 ResultSetMetaData.columnNullableUnknown |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setSigned(int columnIndex, boolean property) throws SQLException
設(shè)置指定列是否為有符號數(shù)。 默認(rèn)值為 false。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
property | 如果該列是有符號數(shù),則為 true; 如果不是,則為 false |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setColumnDisplaySize(int columnIndex, int size) throws SQLException
將指定列的正常最大寬度(以字符為單位)設(shè)置為給定的 int。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
size | 指定列的正常最大字符數(shù) |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setColumnLabel(int columnIndex, String label) throws SQLException
將建議的列標(biāo)題設(shè)置為用于打印輸出和顯示(如果有)給給定的字符串。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
label | 列標(biāo)題 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setColumnName(int columnIndex, String columnName) throws SQLException
將指定列的名稱設(shè)置為給定的字符串。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
columnName | 指定列的名稱 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setSchemaName(int columnIndex, String schemaName) throws SQLException
將指定列的表模式的名稱(如果有)設(shè)置為給定的字符串。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
schemaName | 架構(gòu)名稱 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setPrecision(int columnIndex, int precision) throws SQLException
將指定列的小數(shù)位數(shù)設(shè)置為給定的 int。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
precision | 小數(shù)位數(shù)的總數(shù) |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setScale(int columnIndex, int scale) throws SQLException
將指定列的小數(shù)點右側(cè)的位數(shù)設(shè)置為給定的 int。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
scale | 小數(shù)點右邊的位數(shù) |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setTableName(int columnIndex, String tableName) throws SQLException
將指定列的表名(如果有)設(shè)置為給定的字符串。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
tableName | 列的表名 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setCatalogName(int columnIndex, String catalogName) throws SQLException
將指定列的表的目錄名稱(如果有)設(shè)置為給定的字符串。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
catalogName | 列的目錄名稱 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setColumnType(int columnIndex, int SQLType) throws SQLException
將指定列的 SQL 類型設(shè)置為給定的類型。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
SQLType | 列的 SQL 類型 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
void setColumnTypeName(int columnIndex, String typeName) throws SQLException
將特定于數(shù)據(jù)源的指定列的類型名稱(如果有)設(shè)置為給定的字符串。
參數(shù):
參數(shù)名稱 | 參數(shù)描述 |
---|---|
columnIndex | 第一列是 1,第二列是 2,... |
typeName | 數(shù)據(jù)源特定類型名稱。 |
Throws:
Throw名稱 | Throw描述 |
---|---|
SQLException | 如果發(fā)生數(shù)據(jù)庫訪問錯誤 |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: