72.5k views
3 votes
What information may be obtained from a ResultSetMetaData object?(TCOs 1–6) What information may be obtained from a ResultSetMetaData object?

Number of columns in the result set
Database URL and product name
Number of rows in the result set
JDBC driver name and version

1 Answer

5 votes

Answer:

The correct answer for the given question is " Number of columns in the result set" .

Step-by-step explanation:

In java the ResultSetMetaData is an interface which is used to getting metadata .

The ResultSetMetaData getting the metadata of a table like number of column ,total column etc.

Their are following method of ResultSetMetaData interface

int getColumnCount():it return total number of column in ResultSet object.

String getColumnName(int index):returns the column name

For example

ResultSet r;

ResultSetMetaData sm=r.getMetaData(); // where r is ResultSet

sm.getColumnCount()); :It return total column in table

sm.getColumnName(1)): it return the column name .

User Xno
by
5.1k points