aspose file tools*
The moose likes JSP and the fly likes Logic for dealing with resultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Logic for dealing with resultSet " Watch "Logic for dealing with resultSet " New topic
Author

Logic for dealing with resultSet

Aman Singh
Ranch Hand

Joined: Oct 30, 2008
Posts: 57
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) )


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18168
    
    8

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logic for dealing with resultSet
 
Similar Threads
Can not Populate the form on combo box change
Access Data from Database By Submitting The select Values
JSP attendance management project error
web application in eclipse 9
Multiple forms in a single JSP page