public interface ResultSetMetaData
An object that can be used to get information about the types and properties of the columns in a ResultSet
object. The following code fragment creates the ResultSet
object rs, creates the ResultSetMetaData
object rsmd, and uses rsmd to find out how many columns rs has and whether the first column in rs can be used in a WHERE
clause.
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2"); ResultSetMetaData rsmd = rs.getMetaData(); int numberOfColumns = rsmd.getColumnCount(); boolean b = rsmd.isSearchable(1);Field Summary
static int
columnNoNulls
NULL
values. static int
columnNullable
NULL
values. static int
columnNullableUnknown
String
getCatalogName(int column)
String
getColumnClassName(int column)
ResultSet.getObject
is called to retrieve a value from the column. int
getColumnCount()
ResultSet
object. int
getColumnDisplaySize(int column)
String
getColumnLabel(int column)
String
getColumnName(int column)
int
getColumnType(int column)
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)
static final int columnNoNulls
NULL
values.
static final int columnNullable
NULL
values.
static final int columnNullableUnknown
int getColumnCount() throws SQLException
ResultSet
object.
SQLException
- if a database access error occurs
boolean isAutoIncrement(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
boolean isCaseSensitive(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
boolean isSearchable(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
boolean isCurrency(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
int isNullable(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
columnNoNulls
, columnNullable
or columnNullableUnknown
SQLException
- if a database access error occurs
boolean isSigned(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
int getColumnDisplaySize(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
String getColumnLabel(int column) throws SQLException
AS
clause. If a SQL AS
is not specified, the value returned from getColumnLabel
will be the same as the value returned by the getColumnName
method.
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
String getColumnName(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
String getSchemaName(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
int getPrecision(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
int getScale(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
String getTableName(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
String getCatalogName(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
int getColumnType(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
Types
String getColumnTypeName(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
SQLException
- if a database access error occurs
boolean isReadOnly(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
boolean isWritable(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
boolean isDefinitelyWritable(int column) throws SQLException
column
- the first column is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurs
String getColumnClassName(int column) throws SQLException
Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject
is called to retrieve a value from the column. ResultSet.getObject
may return a subclass of the class returned by this method.
column
- the first column is 1, the second is 2, ...
ResultSet.getObject
to retrieve the value in the specified column. This is the class name used for custom mapping.
SQLException
- if a database access error occurs
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4