A question for resultset to get data in <td>
Dear all
one of question to get data from resultset , for example in i have some data in database , the data type like this ,
product : a 1
a 2
b 1
b 3
how i the idea of method i can display that result in my jsp
<td rowspan="4" align="center" bgcolor="#FFFF99" style="padding-left: 6px; padding-right: 6px; padding-top: 5px; padding-bottom: 3px">product A</td>
</tr>
<td align="center" bgcolor="#FFEBD7" style="padding-left: 6px; padding-right: 6px; padding-top: 5px; padding-bottom: 3px">1</td>
</tr>
<tr>
<td align="center" style="padding-left: 6px; padding-right: 6px; padding-top: 5px; padding-bottom: 3px">2</td>
</tr>
[1001 byte] By [
roger5089a] at [2007-11-27 6:51:05]

# 1
What kind of components are you already using? Custom tag library? Normally you would get the data from the resultset, and put it into Javabeans in the request or session scope attribute. Then you would use a loop custom tag to loop through those beans and display on the page.
however, if you arent using custom tags, you could just use a scriptlet or something more primitive...
Chris
# 2
i use custom tag to achieve this project .
which way can you suggest to do it .
for example
String[] groupanmes = new String[1000];
conn = DriverManager.getConnection("proxool.myDB");
if(conn !=null){
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
rst = stmt.executeQuery("select * from salegroup where username ='"+user+"'");
int i =0;
while(rst.next()){
groupanmes[i] = rst.getString("GROUPNAME");
i++;
}//end if
Message was edited by:
roger5089