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

please tell me the name and url path for type-4 driver ?

2835


How can you use preparedstatement in jdbc?

777


What are the differences between stored procedure and functions?

760


How can you make a connection?

756


What is JDBC API and when do we use it?

786


What is encrypted connection?

776


What is the difference between jdbc and odbc?

760


Explain some new features available in jdbc 4.0?

807


What are the different types of locking in JDBC?

787


Write a program JDBCcode forfetching student database with SQL.

810


Does jdbc use ssl?

713


How to test jdbc connection to sql server?

734


What is statement and preparedstatement in java?

672


Explain the difference between inner and outer join ?

737


What are the jdbc drivers in java?

753