• 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

it is for retriving data from database

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cood afternoon sir
i stored student information with fields sid,sname,fname,address,age in mysql databae.
if i give the sid of a student
it has to check whether it present or not in the database,if so it has to give that student information.
please help me how write this condition in a jsp
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by bhagya raavi:
cood afternoon sir
i stored student information with fields sid,sname,fname,address,age in mysql databae.
if i give the sid of a student
it has to check whether it present or not in the database,if so it has to give that student information.
please help me how write this condition in a jsp



We believe in self help here , so just a couple of hints:

1.) Read up on how to use the sql package and/or sql tag libraries in JSP (plenty of tutorials and code samples out there, just Google it).

2.) Read up on how to take the result of that query and put it into a bean that your page can use (again plenty of tutorials out there).

Cheers,
Martijn
 
bhagya raavi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Martijn Verburg:


We believe in self help here , so just a couple of hints:

1.) Read up on how to use the sql package and/or sql tag libraries in JSP (plenty of tutorials and code samples out there, just Google it).

2.) Read up on how to take the result of that query and put it into a bean that your page can use (again plenty of tutorials out there).

Cheers,
Martijn

thankyou sir
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can either execute two mysql statements, first to see if the student with the sid is present in the database and then to retrieve the student.

Or
execute the statement to retrieve the student and set a data member to null if the student is not present on the database...

Do you have a Student class?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic