Question - What is the main purpose of the ResultSetMetaData interface?
Answer -
This interface gives more information about ResultSet. Each ResultSet object has been associated with one ResultSetMetaData object.
This object will have the details of the properties of the columns like datatype of the column, column name, the number of columns in that table, table name, schema name, etc., getMetaData() method of ResultSet object is used to create the ResultSetMetaData object.
Syntax:
PreparedStatement pstmntobj = conn.prepareStatement(insert_query);
ResultSet resultsetobj = pstmntobj.executeQuery(“Select * from EMPLOYEE”);
ResultSetMetaData rsmd obj= resultsetobj.getMetaData();