Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 17th, 2005, 08:51 AM
abhit_kumar abhit_kumar is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 22 abhit_kumar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 3 sec
Reputation Power: 0
print multiple times..multiple rows...

this below code is used for the retrieving values from the table.

The tables have several rows...


my prob.. is that when i retrieve more than one rows values..it print two times the same rows..

if i retrieve 3 rows values..it prints three times the same rows..

plz help me in my code....where is the prob...plz...

code:-

while(results.next()){



for (int j = 1; request.getParameter((j==1)?"Ac.code""Ac.code_" +j)) != null; j++) {


out.println("<tr><td> <INPUT TYPE='TEXT' NAME='ac_code' size='12' value='" +request.getParameter((j==1)?"Ac.code""Ac.code_" +j)) + "' readonly </td>");

out.println("<td><INPUT TYPE='TEXT' NAME='description' size='12' value='" + request.getParameter((j==1)?"description""description_" +j))+ "' readonly </td>");

out.println("<td> <INPUT TYPE='TEXT' NAME='description' size='12' value='" + request.getParameter((j==1)?"description1""description1_" +j)) + "' readonly </td>");
out.println("</tr> ");
}

Reply With Quote
  #2  
Old January 22nd, 2005, 04:11 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m 17 sec
Reputation Power: 15
I must admit I cannot point to the error at once. I'm no java expert,
merely an amateur in both senses of the word.
But when I see a loop inside a loop like this :

while(results.next()){

for (int j = 1;


I get very sceptic about the need of the second loop.
Why do you need two loops ?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > print multiple times..multiple rows...


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap