Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

ResultSet question

  Asked By: Carolina    Date: Jun 10    Category: Java    Views: 764

I can't find two methods from API that i really
need at the moment.<br>1.How can i get the number of
columns inside my java.sql.ResultSet object? I made my
own method for that, but API method could be more
nice.<br>2.How can i get each column name?



1 Answer Found

Answer #1    Answered By: Luigi Fischer     Answered On: Jun 10

You'll need to use ResultSetMetaData to get the
details of the results returned.<br>ResultSet
rsSet;<br>ResultSetMetaData rsMeta = rsSet.getMetaData();<br><br>This will
allow you to get rows, column  names, etc.

Didn't find what you were looking for? Find more on ResultSet question Or get search suggestion and latest updates.