Whereas firstName, lastName and so on are stored and set in a java bean. It makes it easy to retrieve the variable later on by using getWhateverName.
However in my case I don't have the luxury of setting a firstName or lastName.. I access various tables and databases and have a thousand different queries that are used.
I've gotten results to work using jsp scriptlets and just using out.print in java servlets. I run the query and display the results.
But in JSTL how would I access the various rows without knowing what the column names are. Like I said it's hard to add exact column names in a javabean. There are thousands of them in various databases.
Some of the dbs and tables change every month, week, and so on. It would be a waste to set up setColumnOne and getColumnOne in a javabean if that column is deleted next week or if they add another column next month. It happens often. New materials, new tools, new equipment, new usages.
It's much easier reading how many columns there are for a table, setting the column names on the fly, then retrieving the results.
I'm not sure how to do this just using JSTL.
Maybe I'm storing my results wrong or maybe I'm storing my bean wrong. I'm really not sure how to move on at this point, except of course not using JSTL at all.
Firstly. resultset and JSP should never be used in the same sentence! It's considered really bad practice to send something as db specific to the UI, not to mention the fact that you are holding the connection open during that time.
Conventionally, a JavaBean is created for each row. But, if as you posted, that's a non-starter, I'd consider a Map for each row. You can query the result set metadata for the names of the columns and included a list of those in conjunction with the map so you'll know what the key/property names will be.
I've been using JSTL to display my DB results. At first the JSP page using JSTL displayed ----- {ABC(key)=123(value), XYZ(key)=345(value)} {AAA=333, BBB=444} and so on for each row. -----
Then I tried a couple of different things to get each key and value but now it seems I do read each value and key, but display nothing.