03
Jun
10

find the number of columns in a ResultSet



Suppose you have a ResultSet and you want to find out how many columns it holds. Here’s how you do it:


ResultSet rs = statement.executeQuery();
ResultSetMetaData metaData = rs.getMetaData();
int numberOfColumns = metaData.getColumnCount();


0 Responses to “find the number of columns in a ResultSet”



  1. Leave a Comment

Leave a comment


Blog Stats

  • 281,547 hits