View Single Post
  #3 (permalink)  
Old 05-07-04, 12:54 AM
oh_maan oh_maan is offline
New Member
 
Join Date: May 2004
Location: trichur,kerala
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
ResultSetMetaData class has a method called getColumn Name...u se that to get the name of the column with which u are workin...resultSet intially points to a empty column..u'll have to do resultSet.next to make it point to the first row.


Quote:
Originally Posted by Nerddette
I have been given the following snippet of code, which is part of a ResultSetModel.java file which is used by a file which uses JDBC/SQL data.

Code:
public String getColumnName (int columnIndex) {
        ResultSetMetaData  resultSetMetaData = resultSet.getMetaData();
        //Put some program code here. (They put this in, not me :))
    }
It then tells me to "use one of its methods, so that the above function returns an appropriate heading for each column. "

The GUI columns currently show as the defaults (a-e) and instead I want them to show ComNum, FirstName, Surname, Gender, CountryCode.

Any ideas???

Nerddette
__________________
There are 10 types of people in this world.. those who understand binary and those who dont!

R.Sreeram
Final Year B.Tech CSE
National Institute Of technology
Warangal - 506004
A.P
India

Ph# 9440313620
Reply With Quote