To Create A College Management System Using Servlets With JDBC Ex - No:2.3b Date
To Create A College Management System Using Servlets With JDBC Ex - No:2.3b Date
3b
Date:
Question:
Develop a web application using HTML &Servlets for the given scenario below:
(Required database tables implementation must be done)
Consider you need to create a module in the project College Management system. In your
module you need to create the option for new staff registration by getting the staffs Name,
employee no, qualification and designation from the admin. You have to include the facility to
store and maintain all the details in database table. To give the conformation to the admin about
new faculty registration, print the staffs registration details at the end of your module execution.
Implement your module.
Aim:
To create a module in the project College Management system and perform the given
operations.
Program:
<!DOCTYPE html>
<html>
<head>
<title>LIBRARY MANAGEMENT SYSTEM</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form name="BOOK" method="get" action="http://localhost:8080/twopointthree/dbtwo">
<h1>LIBRARY MANAGEMENT SYSTEM </h1><br><h3>ACCESS NUMBER</h3>
<BR>
<pre>
id="1"><br>
<input type="submit" value="submit"/>
</pre>
</form>
</body>
</html>
PROGRAM 2:
import java.sql.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class dbtwo extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String book=request.getParameter("book");
}
catch(SQLException e)
{
out.println(e);
}
catch(ClassNotFoundException e)
{
out.println(e);
}
catch(Exception e)
{
out.println(e);
}
finally
{
try {
con.close();
} catch (Exception ex) {
Logger.getLogger(dbone.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
Output:
Result:
Thus the project College Management system was created and performed the given
operations successfully.