• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP Problem

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah i m not sure how to start..
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic