Using JDBC to Create Database Objects
By James W. Cooper2003-05-24
ResultSetMetaData
You obtain the ResultSetMetaData object from the ResultSet using the getMetaData() method. You can use this object to discover the number and type of columns and the names of each column.
getColumnCount(); | Returns the number of columns in the ResultSet. | ||
getColumnName(int); | Returns the name of column nnumber int. | ||
getColumnLabel(int); | Returns the suggested label for that column. | ||
isCurrency(int); | Returns true if this column contains a number in currency units. | ||
isReadOnly(int); | Returns true if the column is read only. | ||
isAutoIncrement(int); | Returns true if this column is autoincrement. Such columns are usually keys and are always read-only. | ||
getColumnType(int); | Returns the SQL data type for this column. These data types include
| ||
Tutorial Pages:
» What is a Database?
» Getting Data out of Databases
» Kinds of Databases
» ODBC
» What Is JDBC?
» Installing and Using JDBC
» Types of JDBC Drivers
» Two-Tier and Three-Tier Models
» Writing JDBC Code to Access Databases
» Registering Your Database with ODBC
» Connecting to a Database
» Accessing the Database
» The ResultSet
» ResultSetMetaData
» DatabaseMetaData
» Getting Information on Tables
» Executing SQL Queries, Printing out ResultSets, A Simple JDBC Program
» Building Higher Level JDBC Objects
» Building a Database Object, A Visual Database Program
» Executing a Query
» The Query Result Dialog
» Example Files
» Summary
First published by IBM DeveloperWorks
