
Hi,
Please help me with the following program. I am not able to update all the pa column values in my database.
csea.jsp:
<html>
<body>
<%@page import="java.sql.*"%>
<form method="post" action="csea.jsp">
<table border="1">
<tr><th>Reg No</th><th>Name</th><th>Present/Absent</th></tr>
<%
String pa = request.getParameter("pa");
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Studentwt");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from csea");
while (rs.next()) {
%>
<tr><th><%=rs.getString("reg_no")%></th><th><%=rs.getString("s_name")%></th>
<th><input type="text" name="pa"/></th>
</tr>
<%
}
st.executeQuery("update csea set pa='"+pa+"'");
con.close();
st.close();
rs.close();
} catch (Exception e) {
}%>
</table>
<input type="submit" name="submit" value="SUBMIT"/>
</form>
</body>
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.