getMetaData()
Syntax:
ResultSetMetaData getMetaData() throws SQLException
Description:
Retrieves a ResultSetMetaData
object that contains information about the columns of the ResultSet
object that will be returned when this PreparedStatement
object is executed.
Because a PreparedStatement
object is precompiled, it is possible to know about the ResultSet
object that it will return without having to execute it. Consequently, it is possible to invoke the method getMetaData
on a PreparedStatement
object rather than waiting to execute it and then invoking the ResultSet.getMetaData
method on the ResultSet
object that is returned.
Returns:
the description of a ResultSet
object's columns or null if the driver cannot return a ResultSetMetaData
object
Throws:
SQLException - if a database access error occurs or the prepared statement has been closed
Reference:
For more information, reference JDBC documentation for: PreparedStatement.getMetaData()