Hey guys,
I've decide to expand my knowledge of web based technology and have gone with Java/JSP to start with. As I'm so new to it this may be a stupid question!
I have a Javabean which is called from a JSP page. This Javabean then connects to a MySQL database and runs a query. The results of the query are then stored as a string in an array e.g. results[1] = name1, results[2] = name2 ...
This bit works fine and the array is populated as required. My problem is that I want to display the query results back on the JSP page. In the Javabean all that I seem to be allowed to return is results[x] (where X is a number), rather than the whole array. I want to have the whole array passed back to the JSP page so that I can then run a loop to expand and print it out.
I thought this would be easy enough to do, but it seems it is not as easy as expected! I cannot find any examples on the Internet and everything I have tried does not seem to work.
Since I can find no examples I guess that I am doing it all wrong, but I can't find any examples of how to do it the right way either! How should this be done so that I can get all the results back and printed on screen?
Thanks for any help.