Take a scenario in which a query like “select * from Table1” is executed at database using the
Statement object and the ResultSet object is returned. The column count and the data type of each
column are not known. ResultSet object does’t provide any methods to get the information about the
data it has stored. So to get such information, we were provided an interface ResultSetMetaData which
is available in the package “java.sql”. Meta data means data about the data. As ResultSetMetaData is an
interface, we cannot create an object to it directly by using the keyword “new”. ResultSet interface has a
method getMetaData() which returns ResultSetMetaData object. Below are some of the most useful
methods available in ResultSetMetaData.
Statement object and the ResultSet object is returned. The column count and the data type of each
column are not known. ResultSet object does’t provide any methods to get the information about the
data it has stored. So to get such information, we were provided an interface ResultSetMetaData which
is available in the package “java.sql”. Meta data means data about the data. As ResultSetMetaData is an
interface, we cannot create an object to it directly by using the keyword “new”. ResultSet interface has a
method getMetaData() which returns ResultSetMetaData object. Below are some of the most useful
methods available in ResultSetMetaData.
Visit articles page of the website learningmela.com to download the document and for more details.