转载地址:http://blog.sina.com.cn/s/blog_80e498b10100xxf6.html
public interface ResultSetMetaData可用于获取关于 ResultSet 对象中列的类型和属性信息的对象。以下代码片段创建 ResultSet 对象 rs,创建 ResultSetMetaData 对象 rsmd,并使用 rsmd 查找 rs 有多少列,以及 rs 中的第一列是否可以在 WHERE 子句中使用。
方法摘要 | |
---|---|
String | getCatalogName(int column) |
String | getColumnClassName(int column) ResultSet.getObject 从列中检索值,则返回构造其实例的 Java 类的完全限定名称。 |
int | getColumnCount() ResultSet 对象中的列数。 |
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) |