• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Problem

 
Sanny kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All, I'm having a bit of trouble writing code.
i want to display the records from the database table which looks like this
name month sal month sal month sal
sk 5 20000 6 20000 7 20000
abc 5 787 6 666 7 76666.


the records are stored in the database are vertical..i want the o/p like above.i m using vectors bt im getting problem..can anyone help me ??

Thanks
sanny
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you written so far? What specifically is confusing you, or are you just unsure how to get started?
 
Sanny kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
i want to display the records into JSP page from the database table in this format.

Name month sal month sal month sal
abc 4 454 5 7887 6 5600
ayu 5 55 4 6786 6 6654

hope u understand
qry="select name,month,sal from table;
rs=st.executeQuery(qry);
while(rs.next())
{

}
 
Sanny kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah i m not sure how to start..
 
stan ioffe
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand, you want to print out all month/sal for each name?
Then it's a double loop.
First get all names,
then for each name get month/sal information.

So, your output would be like this:
for each name, Print NAME, then, in the same row, print out all month/sal columns.
Repeat for the next name.

Does that explain it?
-stan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic