public interface ResultSetMetaData extends Wrapper
ResultSet
对象列的类型和属性信息的对象。下面的代码片段创建对象的
ResultSet
RS,创造
ResultSetMetaData
对象RSMD,采用RSMD找出多少列RS,RS第一列是否可以用在
WHERE
条款。
连接数据库为支撑。executeQuery(“选择A,B,C表”);结果集元数据getmetadata() RSMD =卢比;国际numberofcolumns = RSMD。getcolumncount();布尔B = RSMD issearchable(1);
Modifier and Type | Field and Description |
---|---|
static int |
columnNoNulls
恒表示列不允许
NULL 值。
|
static int |
columnNullable
恒表示列允许
NULL 值。
|
static int |
columnNullableUnknown
不断的显示列的值为空性是未知的。
|
Modifier and Type | Method and Description |
---|---|
String |
getCatalogName(int column)
获取指定的列的表的目录名称。
|
String |
getColumnClassName(int column)
返回的java类的实例的制造如果方法
ResultSet.getObject 叫做从列中检索值的完全限定名称。
|
int |
getColumnCount()
在这
ResultSet 对象返回的列数。
|
int |
getColumnDisplaySize(int column)
指示指定列在字符中的正常最大宽度。
|
String |
getColumnLabel(int column)
获取指定列的显示名称用于打印和显示。
|
String |
getColumnName(int column)
获取指定的列的名称。
|
int |
getColumnType(int column)
检索指定列的SQL类型。
|
String |
getColumnTypeName(int column)
检索指定的列的数据库特定类型名称。
|
int |
getPrecision(int column)
获取指定列的指定列大小。
|
int |
getScale(int column)
获取指定列的数字到小数点的右边。
|
String |
getSchemaName(int column)
获取指定的列的表的模式。
|
String |
getTableName(int column)
获取指定的列的表名称。
|
boolean |
isAutoIncrement(int column)
指示指定的列是否自动编号。
|
boolean |
isCaseSensitive(int column)
指示是否列的情况事项。
|
boolean |
isCurrency(int column)
指示指定的列是否为现金值。
|
boolean |
isDefinitelyWritable(int column)
指示是否在指定的列上写一定会成功。
|
int |
isNullable(int column)
显示在指定的列的值为空性。
|
boolean |
isReadOnly(int column)
指示指定的列是绝对不可写。
|
boolean |
isSearchable(int column)
指示指定的列是否可以在其中使用的子句中使用。
|
boolean |
isSigned(int column)
指示指定列中的值是否有符号数。
|
boolean |
isWritable(int column)
指示是否在指定的列上写入成功是可能的。
|
isWrapperFor, unwrap
static final int columnNoNulls
NULL
值。
static final int columnNullable
NULL
值。
static final int columnNullableUnknown
int getColumnCount() throws SQLException
ResultSet
对象返回的列数。
SQLException
-如果一个数据库访问错误发生
boolean isAutoIncrement(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
boolean isCaseSensitive(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
boolean isSearchable(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
boolean isCurrency(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
int isNullable(int column) throws SQLException
column
-第一列是1,其次是2,…
columnNoNulls
,
columnNullable
或
columnNullableUnknown
SQLException
-如果一个数据库访问错误发生
boolean isSigned(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
int getColumnDisplaySize(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
String getColumnLabel(int column) throws SQLException
AS
子句指定。如果没有指定一个SQL
AS
,从
getColumnLabel
返回的值将作为价值的
getColumnName
方法返回相同。
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
String getColumnName(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
String getSchemaName(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
int getPrecision(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
int getScale(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
String getTableName(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
String getCatalogName(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
int getColumnType(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
Types
String getColumnTypeName(int column) throws SQLException
column
-第一列是1,其次是2,…
SQLException
-如果一个数据库访问错误发生
boolean isReadOnly(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
boolean isWritable(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
boolean isDefinitelyWritable(int column) throws SQLException
column
-第一列是1,其次是2,…
false
否则
true
;
SQLException
-如果一个数据库访问错误发生
String getColumnClassName(int column) throws SQLException
返回的java类的实例的制造如果方法ResultSet.getObject
叫做从列中检索值的完全限定名称。ResultSet.getObject
可能返回此方法返回的子类的类。
column
-第一列是1,其次是2,…
ResultSet.getObject
用于检索指定列中的值。这是用于自定义映射的类名称。
SQLException
-如果一个数据库访问错误发生
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.