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 in term of jdbc a datasource?

0 Answers  


how you will execute the many tables data

1 Answers   Wipro,


What happens if we don't close the connection in jdbc?

0 Answers  


Can you create an index on sex column where there is M or F?

1 Answers   Wipro,


What is the exception thrown by JDBC ?

7 Answers  






Explain the steps in writing a java program using jdbc?

0 Answers  


What are database warnings in jdbc and how can we handle database warnings in jdbc?

0 Answers  


Are all the required JDBC drivers to establish connectivity to my database part of the JDK?

0 Answers  


What is JDBC Transaction Management and why do we need it?

0 Answers  


How can I retrieve a String or other object type without creating a new object each time?

0 Answers  


What is jdbc driver manager?

0 Answers  


How can I write to the log used by DriverManager and JDBC drivers?

0 Answers  


Categories