How to find the column count in resultset?



How to find the column count in resultset?..

Answer / 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

More JDBC Interview Questions

What is jdbc in dbms?

0 Answers  


What does jdbc stand for?

0 Answers  


What is jdbc architecture in java?

0 Answers  


Why do we use jdbc statements?

0 Answers  


What are the ddl statements?

0 Answers  


How to set the attribute concurrency in resultset?

0 Answers  


Why do we need jdbc api?

0 Answers  


What are the different types of lockings in jdbc?

0 Answers  


What is the purpose of jdbc?

0 Answers  


Explain the various types of locking system in jdbc?

0 Answers  


What is jdbc url for mysql?

0 Answers  


Why do I have to reaccess the database for Array, Blob, and Clob data?

0 Answers  


Categories