How to find the column count in resultset?

Answer Posted / babu h m

We need to use MetaData option on the ResultSet in order to
get the column count

ResultSet xSet = stmt.executeQuery() ;
ResultSetMetaData rsMetaData = xSet.getMetaData() ;
int numOfColumns = rsMetaData.getColumnCount() ;

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is metadata in programming?

767


What is executeupdate in java?

662


Why do we need a jdbcrowset like wrapper around resultset?

969


How do you determine the sensitivity of the ResultSet object?

752


What is device controller?

712


How can we maintain the integrity of a database by using jdbc?

751


What is the most common example type 1 driver?

788


What is data source in java?

720


What is setautocommit in jdbc?

674


What does connection pooling mean ?

761


How can I know when I reach the last record in a table, since JDBC doesn't provide an EOF method?

776


What is jdbc url for mysql?

778


How do I find ojdbc jar version?

685


Where is jdbc url mysql?

704


What causes no suitable driver error?

735