Computing.Net > Forums > Web Development > jsp: building from ResultSet

jsp: building from ResultSet

Reply to Message Icon

Original Message
Name: liliyaw
Date: April 19, 2006 at 13:05:15 Pacific
Subject: jsp: building from ResultSet
OS: linux
CPU/Ram: 524
Model/Manufacturer: don't know
Comment:

Hi everyone,
I'm new to jsp and I have a basic question about RecordSet.
I want to build a map out of my ResultSet rs.
What I have now is :

String paramValue="";
paramValue = rs.getString("T2");
map.put("T2", paramValue);
paramValue = rs.getString("T3");
map.put("T3", paramValue);
paramValue = rs.getString("C1");
map.put("C1", paramValue);

The problem with the above is that there are many fields and I would prefer not to access them one at a time, as above.
So, can anyone tell me if there is a way I could maybe create 2 arrays out of ResultSet rs (one with fields names, one with fields values) - the actual syntax of it? And then simply have a loop for traverse the two arrays and populating my map with their values.
Thanks in advance.


Report Offensive Message For Removal








Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: jsp: building from ResultSet

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge