GTU WTAD Practical 16 : Assume that the information regarding the marks for all the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.

GTU WTAD Practical 16 :  Assume that the information regarding the marks for all the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.

GTU WTAD Practical 16 :  Assume that the information regarding the marks for all the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.

Database is the most important features of all server side scripting language, Here I have explained how we can connect with MySQL Database using Servlet. Make sure to install WAMP before you execute this program or you can also install MySQL Standalone if you have. Once you install MySQL you need to create database named “mydatabase”. Create table named “student_marks” with few fields as shows below. Make sure to include JAR file before you execute. Kindly refer my previous article to get more details about database.

Database Configuration

  • Database Used : MySQL
  • Database Name : mydatabase
  • Userid : adarsh
  • Password : patel

Database Table Required

  • Table Name: student_marks
  • Field 1 : enrollment
  • Field 2 : StudentName
  • Field 3 : Subject1Marks
  • Field 4 : Subject2Marks
  • Field 5 : Subject3Marks

File Name : index.jsp

File Location : Tomcat_Apache\webapps\gtu16\

File Name : web.xml

File Location : Tomcat_Apache\webapps\gtu16\WEB-INF

File Name : StudentMarksFromDb.java

File Location : Tomcat_Apache\webapps\gtu16\WEB-INF\classes

 

Output (index.jsp file)

GTU WTAD Practical 16 :  Assume that the information regarding the marks for all the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.

Output of Servlet (If Student Information Found)

GTU_16_2

 

Output (If No Records Found)

GTU WTAD Practical 16 :  Assume that the information regarding the marks for all the subjects of a student in the last exam are available in a database, Develop a Servlet which takes the enrollment number of a student as a request parameter and displays the marksheet for the student.

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative