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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

jsp: building from ResultSet

Reply to Message Icon

Name: liliyaw
Date: April 19, 2006 at 13:05:15 Pacific
OS: linux
CPU/Ram: 524
Product: 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.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Online payments on my pag... asp shutting down?



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: jsp: building from ResultSet

including .js file into jsp page www.computing.net/answers/webdevel/including-js-file-into-jsp-page-/2794.html

calling .jsp script www.computing.net/answers/webdevel/calling-jsp-script/2797.html

clean jsp www.computing.net/answers/webdevel/clean-jsp/2756.html