The document describes developing an advanced Enterprise Java Bean that allows a user to enter registration details in a Registration.jsp form. The data entered by the user is then stored in a database.
Registration.jsp collects the user input fields like username, password, first name, last name and email from the request parameters. JDBC is used to connect to a MySQL database and a prepared statement is executed to insert the user details into a database table. On successful insertion, a message is displayed confirming successful registration.
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
T.Y.B.Sc. Computer Science Practical Record
1. T.Y.B.Sc. Computer Science Roll No.
INDEX
Practical No. Practical Name Page
No.
Date Remark Signature
1. Simple Server-Side Programming
using Servlets . Where user can
get the information about server.
01 to 03 05/12/2015
2. Advance Server-Side
Programming using Servlets.
Where user can get details of his
created table in SQL.
04 to 08 12/12/2015
3. Simple Server-side programming
using JSP for Login page where
after login the page forwarded to
new welcome page and if login
details are wrong then page
transferred to index page.
09 to 12 19/12/2015
4. Advance Server-side
programming using JSP for login
page where login details for user
taken from database created in
SQL. If user_id and password
entered by user is wrong then
page redirected to invalid page or
else redirected to Home page.
13 to 20 02/01/2016
5. Developing Simple Enterprise
Java Beans for addition of two
numbers by taking inputs from
user.
21 to 25 09/01/2016
6. Developing Advance Enterprise
Java Beans. Where user is
entering details of registration
form in Registration.jsp file and
the data entered by user should be
stored in database.
26 to 29 23/01/2016
7. Developing Simple Web services
in Java Demonstrate a simple web
service that generates a response
based on information received
from the client.
30 to 34 06/02/2016
8. Developing Advance Web
services in Java. Develop web
service for calculator applications,
to implement simple arithmetic
Operations. Use WSDL for these
web services to show output.
35 to 39 13/02/2016
2. T.Y.B.Sc. Computer Science Roll No.
Practical No: 1
Practical Name :–
Simple Server-Side Programming using Servlets. Where user can get the information about
server.
Index.jsp :-
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="serverinfo" method="post">
<input type="submit" value="submit">
</form>
</body>
</html>
5. T.Y.B.Sc. Computer Science Roll No.
Practical No: 2
Practical Name :–
Advance Server-Side Programming using Servlets. Where user can get details of his created
table in SQL.
Index.jsp :-
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="dataconnection1" method="POST">
<input type="submit" value="submit">
</form>
</body>
</html>
15. T.Y.B.Sc. Computer Science Roll No.
Practical No: 4
Practical Name:–
Advance Server-side programming using JSP for login page where login details for user taken
from database created in SQL. If user_id and password entered by user is wrong then page
redirected to invalid page or else redirected to Home page.
Index.jsp :-
<%--
Document : index
Created on : Mar 8, 2016, 10:54:04 AM
Author : computerlab
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="TLogin.jsp" method="post">
<table bgcolor="yellow">
<tr><td>User Name:<input type="text" name="userid" size="15"></td></tr>
<tr><td>Password:<input type="password" name="pwd" size="15"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit"
size="10"></td></tr>
</table>
</form>
</body>
</html>
23. T.Y.B.Sc. Computer Science Roll No.
Practical No: 5
Practical Name:–
Developing Simple Enterprise Java Beans for addition of two numbers by taking inputs from
user.
Index.jsp :-
<%--
Document : index
Created on : Feb 12, 2016, 9:08:58 AM
Author : computelab
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form method="post" action="calcservlet">
<input type="text" name="t1">
<input type="text" name="t2">
<input type="submit" value="OK">
</form>
</body>
</html>
24. T.Y.B.Sc. Computer Science Roll No.
calcservlet.java :-
import ejb.calbeanLocal;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class calcservlet extends HttpServlet {
calbeanLocal calbean=new calbeanLocal();
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet calcservlet</title>");
out.println("</head>");
out.println("<body>");
int a=Integer.parseInt(request.getParameter("t1"));
int b=Integer.parseInt(request.getParameter("t2"));
out.println("<h1>Sum ="+calbean.addition(a,b)+" </h1>");
out.println("</body>");
out.println("</html>");
} finally {
out.close();
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the
left to edit the code.">
/**
* Handles the HTTP
* <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
25. T.Y.B.Sc. Computer Science Roll No.
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP
* <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
26. T.Y.B.Sc. Computer Science Roll No.
calbeanLocal.java :-
package ejb;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
@Stateless
@LocalBean
public class calbeanLocal {
public Integer addition(int a, int b) {
return (a+b);
}
}
28. T.Y.B.Sc. Computer Science Roll No.
Practical No: 6
Practical Name:–
Developing Advance Enterprise Java Beans. Where user is entering details of registration form
in Registration.jsp file and the data entered by user should be stored in database.
Index.jsp:
<%--
Document : index
Created on : Mar 2, 2016, 12:10:46 PM
Author : computerlab
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="Registeration1.jsp" method="post">
User Name: <input type="text" name="un"><br/>
Password: <input type="text" name="tp"><br/>
First Name: <input type="text" name="fn"><br/>
Last Name: <input type="text" name="ln"><br/>
Email: <input type="text" name="e"><br/>
<input type="submit" value="Register"><br/>
</form>
</body>
</html>
<%--
32. T.Y.B.Sc. Computer Science Roll No.
Practical No: 7
Practical Name:–
Developing Simple Web services in Java
Demonstrate a simple web service that generates a response based on information received from
the client.
37. T.Y.B.Sc. Computer Science Roll No.
Practical No: 8
Practical Name:–
Developing Advance Web services in Java.
Develop web service for calculator applications, to implement simple arithmetic
Operations. Use WSDL for these web services to show output.