How can I display multiple records in my jsp

I can only display one record from sql to jsp so far...

Page 1 of 1

1 Replies - 3262 Views - Last Post: 01 March 2010 - 10:05 AM Rate Topic: -----

#1 bigz008   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 38
  • Joined: 17-September 09

How can I display multiple records in my jsp

Posted 01 March 2010 - 09:00 AM

Hi, I'm creating a page in which an admin can add multiple records in one table. However, I cannot display multiple records because when I add a record from SQL, it just replaces my other records instead of adding a new row:
 						<td style="width: 85px"><b><%= organisationID %></b></td>
						<td style="width: 50px"><b><%= length %></b></td>
						<td style="width: 50px"><b><%= amount %></b></td>
						<td style="width: 80px"><b><%= trialPeriod %></b></td>
						<td style="width: 100px"><b><%= promoMinutes %></b></td>



FULL CODE:
<% 
           String skuResult[][];
		   skuResult = null;
	try {
	
            
			String []  skuFields = {"orgID", "length", "amount", "trial_period", "promoMins"};
             CRUD skuCRUD = new CRUD ("sku", "skuID");  
			 skuResult = skuCRUD.getRecords(skuFields,0,0);

        } catch (Exception e) { 
Tracer.logERROR("[sku/skuContent.jsp] "+e);
        e.printStackTrace();		} 
			 

    String    skuID="";  
    String    organisationID="";  
    String    cc_flag="";	
    String    length="";  
    String	  amount="";  
    String	  active="";  
	String	  trialPeriod="";  
	String	  description="";  
	String	  promoText="";  
	String	  promoMinutes="";  
	

	
for (int i = 0; i < skuResult.length; i++) {
organisationID = skuResult[i][0]; 
length = skuResult[i][1] ;
amount = skuResult[i][2];
trialPeriod = skuResult[i][3];
promoMinutes = skuResult[i][4];


%> 

<%     Tracer.logERROR("[sku/skContent.jsp] "+"errors are after this"); } %>

<table style="width: 99%">
                <tr>
                <td style="width: 85px;" id="tableheadercell">Organsation ID</td>
				<td style="width: 50px;" id="tableheadercell">Length</td>
				<td style="width: 50px;" id="tableheadercell">Amount</td>
				<td style="width: 80px;" id="tableheadercell">Trial Period</td>
				<td style="width: 100px;" id="tableheadercell">Promo Minutes</td>				
				</tr>

					<tr>
						<td style="width: 85px"><b><%= organisationID %></b></td>
						<td style="width: 50px"><b><%= length %></b></td>
						<td style="width: 50px"><b><%= amount %></b></td>
						<td style="width: 80px"><b><%= trialPeriod %></b></td>
						<td style="width: 100px"><b><%= promoMinutes %></b></td>
					</tr>
</table>				
</html>



I also attached a screen to show you how I only have one record who's data just replaces when I try to add a new one... Attached Image

What is the solution to this? How can I add multiple records in the table, instead of it just replace the values in my previous records? Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: How can I display multiple records in my jsp

#2 Guest_bigz008*


Reputation:

Re: How can I display multiple records in my jsp

Posted 01 March 2010 - 10:05 AM

Why does this folder show up transparent
Was This Post Helpful? 0

Page 1 of 1