Question
Write a program using JSP and JDBC to support editing (address modification, mobile number/ email id update) of MCA 1st Semester students of IGNOU. The program should take enrollment number or registered mobile number as input. Make necessary assumptions required
Answer :
Word Count : 431
To develop a JSP and JDBC-based program for editing the details of MCA 1st Semester students of IGNOU, first, a database table `MCA1_Students` can be assumed with columns `EnrollmentNo`, `Name`, `Address`, `MobileNo`, and `EmailId`. The program will take `EnrollmentNo` or `MobileNo` as input to fetch and update the student's record. JDBC will be used for database connectivity, and JSP will handle the frontend for input and updating. The database connection can be established using a JDBC driver. Assuming MySQL, the connection setup in JSP would look like: ```java <%@ page import="java.sql.*" %> <% String url = "jdbc:mysql://localhost:3306/ignou_db"; String user = "root"; String password = "root"; Connection con = null; Statement stmt = null; ResultSet rs = null; try { Class.forName("com.mysql.cj.jdbc.Driver"); con = DriverManager.getConnection(url, user, password); } catch(Exception e) { out.println("Database connection error: " + e.getMessage()); } %> ``` The input form for searching a student by enrollment number or mobile number can be created in JSP: ```html