Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logic for dealing with resultSet

 
Aman Singh
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts,
I need some trivial help
In the following code, I am displaying a table on my jsp page. The first column on the table is APP_GROUP, which gets populated with Application names and in the same code I am converting the names in HTML links.
The problem I am facing is:
Lets say if I have an application name as: aaa
then I have to make a jsp page with name: aaa.jsp

with this approach I am getting stuck with the naming problem because, I need make use of aaa somewhere else as well.
what I want is some flexibility is creating these hyper links, something where I cant specify any link name ( not just aaa.jsp)

For example:
If there are 5 application names pulled up from the database, i should be able to specify links as:

<td><%=rs.getString(1)%>
<td>
<%=rs.getString(1)%> (here the second value or rs.getString(1) )


  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Result sets should never be dealt with in a JSP page. Move your SQL code to a model Java class, extract the data from the result set as Java collections, close the result set, and forward to the JSP with the data in the collections.

On page, use JSTL and EL to display the data.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. But apart from that, you seem to have a question which has nothing to do with SQL at all. You reference some mysterious "aaa" in your question. It's the name of your application? It's the name of a JSP page? Both? Why is it a problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic