0% found this document useful (0 votes)
29 views47 pages

Aryan Chopda Weekly Diary

Uploaded by

aryanchopda333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views47 pages

Aryan Chopda Weekly Diary

Uploaded by

aryanchopda333
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Weekly Diary for Industrial Training

Name of Industry: SGMS INFOTECHLLP

Training from: 03/06/2024 To 13/07/2024

Name of Supervisor: Ritesh Rama Surange

Designation of Supervisor: Java Developer

NameofStudent: Aryan PrasannaChopda

EnrollmentNo:

Branch of Engineering:Diploma in Computer Engineering.

Name of Polytechnic:

Rasiklal Manikchand Dhariwal Institute of Technology

Specialinstructionstostudents:

1) Write down the daily activity on the same day.

2) Make note of the important actual activities only.

3) Summarize at the week–end.

4) Add extra sheets if needed for daily or weekly activity report.


Expected Work:
i)Study of organizationVision Missionand Quality Policy and chart of industry/plant
with responsibilities of the different posts.
Mentor Assignment–
i) Chart of industry/plant with responsibilities of the different posts.
ii) General Study of industry,its location,its history and its product range,its size,
number of employees, its turnover etc.
Students should write in brief about assignment in weekly diary and write in detail and
submit it to the mentor in soft copy as Assignment No.1

Day Activities carried out

1. Introduction to the Industry,its infrastructure and its working.

2. Introduction to HTML.

3. Understand how to install the EclipseIDE software.

4. Analyze the concept of tables in HTML.

5. Learn how to link two HTML pages using anchor tag.

6. Assignment1
1.To make Home page,Registration page,Login Page and link them.

Weekly summarization of the above activities:

Learnt the basic concepts of the software EclipseIDE andit’s features.

Understood the basic concepts of HTML.

Signature of Student:
Expected Work: Study of Production processes in the industry.

Mentor Assignment
1) List production processes along with production planning and control
procedures.
Students should write in brief about assignment in weekly diary and write in detail and
submit it to the mentor in soft copy as Assignment No.2.

Day Activities carried out

1. Introduction to different Types of HTMLTags.

2. Introduction to JSP and servlet.

3. Learning the<form>tag and its attributes.

4. Introduction to theconcepts of Radiobutton,Text area,Drop down menu in


HTML webpage designing.

5. Understand how tomake simple dynamic web project,with different tags.


6. Assignment 2
1. To make Dynamic web project andTo Configure a Browser.
2. To create a Student registration form for exam.

Weekly summarization of the above activities:

Learn how to make a form using HTML.

Analyzed the form tag in HTML.

Signature of Student:
Expected Work:Study of layout and specifications of major
machines.

Mentor Assignment
i) Study of layout and specifications of major machines,equipment and raw material/
components used

Students should write in brief about assignment in weekly diary and write in detail and
submit it to the mentor in soft copy as Assignment No.3.

Day Activities carried out

1. Introduction to Java script.

2. Analyze the <script> tag and its attributes.

3. Learn how to Make database connectivity using MY SQL Quary.

4. Introduction about place holder in HTML.

5. Learn methods of servlet.


6. Assignment3
1.Create a form and make database connectivity.

Weekly summarization of the above activities:

Learn how to handle the concepts of JSP.

Understand the concept of validation.

Signature of Student:
Expected Work : Testing processes in the industry.

Mentor Assignment:

i) Study of testing and Quality Assurance processes in their industry .

Students should write in brief about assignment in weekly diary and write in detail
and
Submit it to the mentor in soft copy as Assignment No.4.

Day Activities carried out

1. Introduction to configure Apatche Tomcat server.

2. Understand the concept of creating server.

3. Learn how to retrieve information from database and display it.

4. Learn how to perform Operation of Delete data.

5. Learn how to perform Operationo f Updating data.


6. Assignment 4
1. To retrieve information from database and display it.
2. Perform operation like delete and update on form.

Weekly summarization of the above activities:

Learn to make database connectivity using MY SQLQuery.

Learn to retrieve information from database and display it .

Signature of Student:
Expected Work : maintenance procedures in the industry.

Mentor Assignment:

The major mac jines/plants whose preventive eand breakdown maintenance procedures
studied.

Student should write in brief about assignment in weekly dairy and write in detail and
submit it to the mentor in soft copy as assignment No.5

Day Activities carried out

1. Seen the readymade project flow (Online Banking/ATM Locater)

Analyzing the distributed topic (Creating Employee registration


2. form ,after registration data will store in database and retrieve
data ,perform operation like inserting ,deleting ,updating)

3. Discussing about the topics being included in the project.

4. Learning more about the project.

5. Applying the HTML concepts in the project


6. Assignment 5:
Inplant Training project part1(Creating Registration form and make
connectivity using MYSQL Query)

Weekly summarization of the above activities:

Analyzed the project topic and working on it.

Signature of Student:
IN PLANT TRAINING WEEKLY DIARY
Week6:From
Expected Work:i)List the major manuals/broachers such as operational manual,
safety manual, maintenance manual, quality manuals referred/studied there for
preparation of reports.

Mentor Assignment:

ii) The major safety practices adopted in the industry.

Students should write in brief about assignment in weekly diary and write in detail and
submit it to the mentor in soft copy as Assignment No.6.
Day Activities carried out

1. Perform operation like update, delete on project.

2. Discussing about creating the Employee registration form and implementing


it.

3. Understand that how to create a training report.

4. Learn to create a weekly diary report.

5. Checking the project deeply.


6. Assignment6:
Implant Training Project Part2(Creating the Operation like
deletion, updation, insertion.)
ASSIGNMENTS
(Given by the Instruct or of the Industry)
Assignment1
 To mak eHome page,Registration page and link them.

a) Homepage.jsp

<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>Homepage</title>
</head>
<body>
<divalign="center">
<h1>WelcometoHomepage</h1>
<hr/>
<br/><ahref="Registration.jsp">GotoRegestrationpage</a><br/>
<br/><ahref="login.jsp">GotoLoginpage</a>
</div>
</body>
</html>
b) Registration.jsp
<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>Registration</title>
</head>
<body>
<divalign="center">
<h1>WelcometoRegistrationpage</h1>
<hr/>
<br/><ahref="login.jsp">GotoLoginpage</a><br/><br/>
<ahref="Homepage.jsp">GotoHomepage</a></div>
</body>
</html>
c) LoginPage.html
<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>Registration</title>
</head>
<body>
<divalign="center">
<h1>WelcometoRegistrationpage</h1>
<hr/>
<br/><ahref="login.jsp">GotoLoginpage</a><br/><br/>
<ahref="Homepage.jsp">GotoHomepage</a>
</div>
</body>
</html>

*OUTPUT
Assignment2
 To create a Student registration form for exam.

<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>Registration</title>
</head>
<body>
<divalign="center">
<h1>WelcometoRegistrationpage</h1>
<hr/>
<br/>
<Formaction="registration"method="post">
<table>
<tr>
<td>Name</td>
<td><inputtype="text"name="full_name"></td>
</tr>
<tr>
<td>Address</td>
<td><textarearows=4cols=10name="address"></textarea></td>
</tr>
<tr>
<td>Age</td>
<td><inputtype="number"name="age"></td>
</tr>
<tr>
<td>Mobileno</td>
<td><inputtype="number"name="mobileno"></td>
</tr>
<tr>
<td>DateofBirth</td>
<td><inputtype="date"name="DOB"></td>
</tr>
<tr>
<td>Gender</td>
<td><inputtype="radio"name="gender"checked="checked">Male<input
type="radio" name="gender">Female</td>
</tr>
<tr>
<td>Category</td>
<td><selectname="category">
<option>sc</option>
<option>open</option>
<option>St</option>
<option>nt</option>
</select></td>
</tr>
<tr>
<td>Password</td>
<td><inputtype="password"name="password"></td>
<tr>
<tdalign="center"><inputtype="submit"value="registration"><input type="Reset"
name="clear data"></td>
</tr>
</table>
</Form>
<hr/>
</div>
</body>
</html>
*OUTPUT
Assignment3

 Create a form and make database connectivity.


1).Create form.
<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>registrationpage</title>
</head>
<%
if(request.getParameter("reg")!=null)
{
out.print("<script>alert('registationdone')</script>");
}
%>
<body>
<divalign="center">
<h1>UserRegistration</h1>
<hr>
<br>
<formaction="Registration"method="post">
<tableborder=0>
<tr>
<td>Name</td>
<td><inputtype="text"Name="full_name"></td>
</tr>
<tr>
<td>address</td>
<td><textarearows="2"cols="10"name="address"></textarea>
<tr>
<td>Dathofbirth</td>
<td><inputtype="date"Name="dob"></td>
</tr>
<tr>
<td>Gender</td>
<td><inputtype="radio"name="Gender"value="Male">Male<input
type="radio" name="Gender" value="Female">female</td>
</tr>
<tr>
<td>Mobilenumber</td>
<td><inputtype="text"placeholder="mobile"Name="mobil"></td>
</tr>
<tr>
<td>EmailId</td>
<td><inputtype="text"Name="email"></td>
</tr>
<tr>
<td>Password</td>
<td><inputType="password"Name="password"></td>
</tr>
<tr>
<td></td>
<td><inputtype="submit"value="Registration"><input
type="reset" value="clear"></td>
</tr>
</table>
</form>
<ahref=userRecords.jsp>userrecord</a>
</div>
</body>
</html>
2).Database connectivity.
package com.conn;
importjava.sql.Connection;
importjava.sql.DriverManager;//fordrivermanager
public class Databaseconnection
{
staticConnectioncon=null;
publicstaticConnectiongetConnection()
{
try
{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/collage_diploma
","root","");
System.out.println("connectiondone");
}
catch(Exceptione)
{
System.out.println("exceptionoccur");
}
returncon;
}
publicstaticvoidmain(String[]args)
{
Databaseconnection.getConnection();
}
}
2) Registration.java
packagecom.code;

import java.io.IOException;
import java.sql.Connection;
importjava.sql.DriverManager;
importjava.sql.PreparedStatement;

importjavax.servlet.ServletConfig;
import javax.servlet.ServletException;
importjavax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
importjavax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;

/**
*ServletimplementationclassRegistration
*/
@WebServlet("/Registration")
publicclassRegistrationextendsHttpServlet{
privatestaticfinallongserialVersionUID=1L;

publicvoidinit(ServletConfigconfig)throwsServletException{

/**
*@seeHttpServlet#doGet(HttpServletRequestrequest,HttpServletResponse
response)
*/
protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)
throwsServletException,IOException{ System.ou
t.println("Do get Execute");

protectedvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)
throws ServletException, IOException
{ System.out.println("DoPostmethodExecute");

Stringfullname=request.getParameter("full_name");
String address=request.getParameter("address");
String dob = request.getParameter("dob");
StringGender=request.getParameter("Gender");
String mobil= request.getParameter("mobil");
String email= request.getParameter("email");
Stringpassword=request.getParameter("password");

System.out.println("Full Name "+fullname);


System.out.println("Address "+address);
System.out.println("Date Of Birth "+dob);
System.out.println("Gender "+Gender);
System.out.println("MobileNumber"+mobil);
System.out.println("Email ID "+email);
System.out.println("Password "+password);

Connectioncon=null;
try
{
Class.forName("com.mysql.jdbc.Driver");
con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/collage_diploma","r oot","");
System.out.println("ConnectionDone");

}
catch(Exceptione)
{
System.out.println("Exceptionoccurs..!");
}

try{

PreparedStatementps=con.prepareStatement("INSERTINTO
`user_detail`(`fullname`,`address`,`dob`,`Gender`,`mobil`,`email`,`password`) VALUES
('"+fullname+"','"+address+"','"+dob+"','"+Gender+"','"+mobil+"','"+email+"','"+pass
word+"')");
inti=ps.executeUpdate();

System.out.println("i="+i);
if(i>0)
{
System.out.println("Data insert Done "); response.sendRedirect("registration.jsp?
reg=done");
}
else
{
System.out.println("Data Not inserted..!");
response.sendRedirect("first.jsp?reg=fail");
}

}catch(Exceptione)
{
System.out.println("Excpetion"+e);
}
// syso=cntr+spacebar--------System.out.println();

}
*OUTPUT
Assignment4
1).to retrieve information from database and display it.
<%@pageimport="java.sql.Connection"%>
<%@pageimport="java.sql.ResultSet"%>
<%@pageimport="java.sql.PreparedStatement"%>
<%@pageimport="com.conn.Databaseconnection"%>
<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>RetriveInformation</title>
</head>
<body>
<divalign="center">
<h1>Retriveddata</h1>
<hr/>
<table>
<tr>
<th>Id</th>
<th>Full_name</th>
<th>Address</th>
<th>DOB</th>
<th>Gender</th>
<th>Mobil_no</th>
<th>Email_id</th>
<th>password</th>
<th>Operation</th>

</tr>
<%
Connectioncon=Databaseconnection.getConnection();
PreparedStatement ps = con
.prepareStatement("select*fromuser_detail");
ResultSet rs = ps.executeQuery();
while(rs.next()){
Stringid=rs.getString("id");
%>
<tr>
<td><%=rs.getString("id")%></td>
<td><%=rs.getString("fullname")%></td>
<td><%=rs.getString("address")%></td>
<td><%=rs.getString("dob")%></td>
<td><%=rs.getString("Gender")%></td>
<td><%=rs.getString("mobil")%></td>
<td><%=rs.getString("email")%></td>
<td><%=rs.getString("password")%></td>
<td><ahref="DeleteUser?id=<%=id%>">Delete</a></td>
<td><ahref="UpdateRecord.jsp?id=<%=id%>">Update</a></td>
</tr>
<%
System.out.println("Dataisavailable");
}
%>
</table>
</div>
</body>
</html>
*OUTPUT

2).Perform operation like Upadate and delete.


a) UpdateRecord.jsp

<%@pagelanguage="java"contentType="text/html;charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=ISO-8859-1">
<title>Updaterecord</title>
</head>
<body>
<divalign="center">
<h1>Updaterecord</h1>
<hr>
<br>
<formaction="Registration"method="post">
<tableborder=0>
<tr>
<td>Name</td>
<td><inputtype="text"Name="full_name"></td>
</tr>
<tr>
<td>address</td>
<td><textarearows="2"cols="10"name="address"></textarea>
<tr>
<td>Dathofbirth</td>
<td><inputtype="date"Name="dob"></td>
</tr>
<tr>
<td>Gender</td>
<td><inputtype="radio"name="Gender"value="Male">Male<input
type="radio" name="Gender" value="Female">female</td>
</tr>
<tr>
<td>Mobilenumber</td>
<td><inputtype="text"placeholder="mobile"Name="mobil"></td>
</tr>
<tr>
<td>EmailId</td>
<td><inputtype="text"Name="email"></td>
</tr>
<tr>
<td>Password</td>
<td><inputType="password"Name="password"></td>
</tr>
<tr>
<td></td>
<td><inputtype="submit"value="Update"><input
type="reset" value="clear"></td>
</tr>
</table>
</form>
<ahref=userRecord.jsp>userrecord</a>
</div>
</body>
</html>
b) UpdateRecord.java
package com.code;

importjava.io.IOException;

importjava.sql.Connection;
importjava.sql.PreparedStatement;

importjavax.servlet.ServletConfig;
import javax.servlet.ServletException;
importjavax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
importjavax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;

importcom.conn.Databaseconnection;

/**
*ServletimplementationclassUpdateRecord
*/
@WebServlet("/UpdateRecord")
publicclassUpdateRecordextendsHttpServlet{
staticConnectioncon=null;

publicvoidinit(ServletConfigconfig)throwsServletException{
try{
con=Databaseconnection.getConnection();
} catch (Exception e)
{ System.out.println("Exc"+e);
}
}

protected void doPost(HttpServletRequest request,


HttpServletResponseresponse)throwsServletException,IOException{

Stringid=request.getParameter("id");

Stringf_name=request.getParameter("full_name");
Stringaddress=request.getParameter("address");
String dob = request.getParameter("dob");
String gender = request.getParameter("gender");
Stringmobile=request.getParameter("mobilno");
String email = request.getParameter("email");
Stringpasswor=request.getParameter("password");

try{

PreparedStatementps=con
.prepareStatement("UPDATE`user_detail`SET`fullname`='"
+f_name+"',`address`='"+address+"',`dob`='"
+dob+"',`gender`='"+gender+"',`mobile`='"
+mobile+"',`password`='"+passwor
+"'WHERE`id`='"+id+"'");
intr=ps.executeUpdate();
if(r>0){
System.out.println("All Information Updated...!");
response.sendRedirect("userRecord.jsp?update=done");
}else{
System.out.println("Update Operation Fail...!"); response.sendRedirect("userRecord.jsp?
fail=update");
}
} catch (Exception e)
{ System.out.println("Exc"+e);
}
}
}

C).DeleteUser.java
package com.code;

importjava.io.IOException;

importjava.sql.Connection;
importjava.sql.PreparedStatement;
importjava.sql.SQLException;

importjavax.servlet.ServletConfig;
import javax.servlet.ServletException;
importjavax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
importjavax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;

importcom.conn.Databaseconnection;

/**
*ServletimplementationclassDeleteUser
*/
@WebServlet("/DeleteUser")
publicclassDeleteUserextendsHttpServlet {
privatestaticfinallongserialVersionUID=1L;

/**
*@seeServlet#init(ServletConfig)
*/
publicvoidinit(ServletConfigconfig)throwsServletException{
//TODOAuto-generatedmethodstub
}

/**
*@seeHttpServlet#doGet(HttpServletRequestrequest,HttpServletResponse
response)
*/
protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)
throwsServletException,IOException
{
String id=request.getParameter("id");

System.out.println("Delete Record of id"+id);

Connectioncon=Databaseconnection.getConnection();

try
{

PreparedStatementps=con.prepareStatement("DELETEFROM`user_detail`WHERE
id='"+id+"'");
inti=ps.executeUpdate();
if(i>0)
{
System.out.println("Delete Done"+id); response.sendRedirect("userRecord.jsp?
delete=done");
}
else
{
System.out.println("Delete Fail...!");
response.sendRedirect("userRecord.jsp?fail=delete");
}

}catch(Exceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}
}

*OUTPUT
Assignment5

 Creating Registration form and make connectivity using MY SQL Query.

 Index.jsp

<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="utf-8"/>
<metaname="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
<metaname="description"content=""/>
<metaname="author"content=""/>
<title>Employee</title>
<!--Favicon-->
<linkrel="icon"type="image/x-icon"href="assets/favicon.ico"/>
<!--FontAwesomeicons(freeversion)-->
<scriptsrc="https://use.fontawesome.com/releases/v5.15.4/js/all.js"
crossorigin="anonymous"></script>
<!--Googlefonts-->
<linkhref="https://fonts.googleapis.com/css?family=Montserrat:400,700"
rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?
family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css" />
<!--CorethemeCSS(includesBootstrap)-->
<linkhref="css/index-styles.css"rel="stylesheet"/>
</head>
<bodyid="page-top">
<!--Navigation-->
<nav
class="navbarnavbar-expand-lgbg-secondarytext-uppercasefixed-top"
id="mainNav">
<divclass="container">
<aclass="navbar-brand"href="#page-top">Employee</a>
<button
class="navbar-togglertext-uppercasefont-weight-boldbg-primarytext-white rounded"
type="button"data-bs-toggle="collapse"
data-bs-target="#navbarResponsive"aria-controls="navbarResponsive"
aria-expanded="false" aria-label="Toggle navigation">
Menu<iclass="fasfa-bars"></i>
</button>
<divclass="collapsenavbar-collapse"id="navbarResponsive">
<ulclass="navbar-navms-auto">
<liclass="nav-itemmx-0mx-lg-1"><a
class="nav-linkpy-3px-0px-lg-3rounded"href="registration.jsp">Register</a></li>

<liclass="nav-itemmx-0mx-lg-1"><a
class="nav-linkpy-3px-0px-lg-3rounded"href="Details.jsp">ViewEmployee detail</a></li>

<liclass="nav-itemmx-0mx-lg-1"><a
class="nav-linkpy-3px-0px-lg-3rounded"href="index.jsp">Home</a></li>
</ul>
</div>
</div>
</nav>
<!--Masthead-->
<headerclass="mastheadbg-primarytext-whitetext-center">
<divclass="containerd-flexalign-items-centerflex-column">
<!--MastheadAvatarImage-->
<imgclass="masthead-avatarmb-5"src="assets/img/avataaars.svg"
alt="..." />
<!--MastheadHeading-->
<h1class="masthead-headingtext-uppercasemb-0">EmployeeManagment</h1>
<!--IconDivider-->
<divclass="divider-customdivider-light">
<divclass="divider-custom-line"></div>
<divclass="divider-custom-icon">
<iclass="fasfa-star"></i>
</div>
<divclass="divider-custom-line"></div>
</div>
<!--MastheadSubheading-->
<pclass="masthead-subheadingfont-weight-lightmb-0">Rohini
kalshetty</p>
</div>
</header>
</body>
</html>

 Registration.jsp
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<metaname="viewport"content="width=device-width,initial-scale=1.0">
<metahttp-equiv="X-UA-Compatible"content="ie=edge">
<title>RegistrationForm</title>
<!--FontIcon-->
<linkrel="stylesheet"
href="fonts/material-icon/css/material-design-iconic-font.min.css">
<!--Maincss-->
<linkrel="stylesheet"href="css/style.css">
</head>
<body>
<divclass="main">
<!--Signupform-->
<sectionclass="signup">
<divclass="container">
<divclass="signup-content">
<divclass="signup-form">
<h2class="form-title">Registration</h2>
<formmethod="post"action="Registration"class="register-form"
id="register-form">
<divclass="form-group">
<labelfor="name"><i
class="zmdizmdi-accountmaterial-icons-name"></i></label><input
type="text" name="name" id="name" placeholder="Your Name" />
</div>
<divclass="form-group">
<label for="Department"><i class="zmdi zmdi-tv"></i></label><input
type="text"name="dept"id="dept"placeholder="YourDepartment"/>
</div>
<divclass="form-group">
<labelfor="join_date"><iclass="zmdizmdi-calendar"></i></label><input type="date"
name="join_date" id="join_date"/>
</div>
<divclass="form-group">
<labelfor="address"><iclass="zmdizmdi-swap-vertical-circle"></i></label>
<inputtype="text"name="address"id="address"
placeholder="Address" />
</div>

<divclass="form-group">
<labelfor="salary"><iclass="zmdizmdi-balance"></i></label>
<inputtype="text"name="salary"id="salary"
placeholder="Annual salary" />
</div>
<divclass="form-group">
<labelfor="contact"><iclass="zmdizmdi-phone"></i></label>
<inputtype="text"name="contact"id="contact"
placeholder="Contact no" />
</div>
<divclass="form-group">
<span><span></span></span>
</div>
<divclass="form-groupform-button">
<inputtype="submit"name="signup"id="signup"
class="form-submit" value="Register" />
</div>
</form>
</div>
<divclass="signup-image">
<figure>
<imgsrc="images/signup-image.jpg"alt="singupimage">
</figure>
<ahref="Details.jsp">ViewRecord
</a>
</div>
</div>
</div>
</section>
</div>
<!--JS-->
<scriptsrc="vendor/jquery/jquery.min.js"></script>
<scriptsrc="js/main.js"></script>
</body>
<!--ThistemplateswasmadebyColorlib(https://colorlib.com)-->
</html>

 Registration.java
packagecom.code;
import java.io.IOException;
import java.sql.Connection;
importjava.sql.DriverManager;
import java.sql.PreparedStatement;
import javax.servlet.ServletConfig;
importjavax.servlet.ServletException;
importjavax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;
/**
*ServletimplementationclassRegistration
*/
@WebServlet("/Registration")
publicclassRegistrationextendsHttpServlet{ priv
ate static final long serialVersionUID = 1L;
publicvoidinit(ServletConfigconfig)throwsServletException{
//TODOAuto-generatedmethodstub
}
/**
* @seeHttpServlet#doGet(HttpServletRequestrequest,HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponseresponse)throwsServletException,IOException{ Sy
stem.out.println("Do get Method execute ");
}
protected void doPost(HttpServletRequest request,
HttpServletResponseresponse)throwsServletException,IOException{ Sy
stem.out.println("Do POST method execute");
Stringname=request.getParameter("name");
String dept = request.getParameter("dept");
Stringjoin_date=request.getParameter("join_date");
String address = request.getParameter("address");
String salary = request.getParameter("salary");
Stringcontact=request.getParameter("contact");

System.out.println("Full Name "+name);


System.out.println("Department "+dept);
System.out.println("Joindate"+join_date);
System.out.println("Address "+address);
System.out.println("salary "+salary);
System.out.println("contact "+contact);
Connection con=null;
try
{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/employee","root
","");
System.out.println("Connectondone");
}
catch(Exceptione)
{
System.out.println("ExceptionOccur"+e);
}
try{
PreparedStatementps=con.prepareStatement("INSERTINTO
`employee_detail`(`name`,`dept`,`join_date`,`address`,`salary`,`contact`)VALUES
('"+name+"','"+dept+"','"+join_date+"','"+address+"','"+salary+"','"+contact+"')");
inti=ps.executeUpdate();
System.out.println("i="+i);
if(i>0)
{
System.out.println("Record Insert Done "); response.sendRedirect("registration.jsp?
reg=done");
}
else
{
System.out.println("InsertionFail...!");
}
}catch(Exceptione)
{
System.out.println("Exc"+e);
}
}
}
 Dtabaseconnection.java
package com.conn;
import java.sql.Connection;
import java.sql.DriverManager;
publicclassDatabaseconnection{ s
tatic Connection con=null;
publicstaticConnectiongetConnection()
{
try
{
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/employee","root
","");
System.out.println("ConnectionDone");
}
catch(Exceptione)
{
System.out.println("Exc"+e);
}
returncon;
}
publicstaticvoidmain(String[]args)
{
Databaseconnection.getConnection();
}
}

 Details.jsp
<%@pageimport="java.sql.ResultSet"%>
<%@pageimport="java.sql.PreparedStatement"%>
<%@pageimport="com.conn.Databaseconnection"%>
<%@pageimport="java.sql.Connection"%>
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="utf-8"/>
<metaname="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no"/>
<metaname="description"content=""/>
<metaname="author"content=""/>
<title>Details</title>
<!--tablecss-->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"rel
="stylesheet"
integrity="sha384-
EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous">
<%
if(request.getParameter("delete")!=null)
{
out.print("<script>alert('DeleteDone...!')</script>");
}
%>
<!--Googlefonts-->
<linkhref="https://fonts.googleapis.com/css?family=Montserrat:400,700"
rel="stylesheet" type="text/css" />
<!--CorethemeCSS(includesBootstrap)-->
<linkhref="css/index-styles.css"rel="stylesheet"/>
</head>
<bodyclass="bg-light">
<!--cssfortable-->

<script
src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"i
ntegrity="sha384-
IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
crossorigin="anonymous"></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"i
ntegrity="sha384-
cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
crossorigin="anonymous"></script>

<!--Navigation-->
<nav
class="navbarnavbar-expand-lgbg-secondarytext-uppercasefixed-top"
id="mainNav">
<divclass="container">
<aclass="navbar-brand"href="#page-top">Employee</a>
<button
class="navbar-togglertext-uppercasefont-weight-boldbg-primarytext-white rounded"
type="button"data-bs-toggle="collapse"
data-bs-target="#navbarResponsive"aria-controls="navbarResponsive"
aria-expanded="false" aria-label="Toggle navigation">
Menu<iclass="fasfa-bars"></i>
</button>
<divclass="collapsenavbar-collapse"id="navbarResponsive">
<ulclass="navbar-navms-auto">
<liclass="nav-itemmx-0mx-lg-1"><a
class="nav-linkpy-3px-0px-lg-3rounded"href="registration.jsp">Register</a></li>

<liclass="nav-itemmx-0mx-lg-1"><a
class="nav-linkpy-3px-0px-lg-3rounded"href="Details.jsp">ViewEmployee detail</a></li>

<liclass="nav-itemmx-0mx-lg-1"><a
class="nav-linkpy-3px-0px-lg-3rounded"href="index.jsp">Home</a></li>
</ul>
</div>
</div>
</nav>

<!--table-->
<br/><br/><br/>
<divclass="containerp-5">
<divclass="card">
<divclass="card-body">
<pclass="text-centerfs-1">AllEmployeeDetails</p>
<tableclass="table">
<thead>
<tr>
<thscope="col">Id</th>
<thscope="col">Name</th>
<thscope="col">Department</th>
<thscope="col">JoiningDate</th>
<thscope="col">Address</th>
<thscope="col">AnnualSalary</th>
<thscope="col">Contact</th>
<thscope="col">Action</th>
</tr>
</thead>
</tbody>
<%
Connectioncon=Databaseconnection.getConnection();
PreparedStatementps=con.prepareStatement("SELECT*FROMemployee_detail");
ResultSet rs=ps.executeQuery();
inti=0;
while(rs.next())
{
Stringid=rs.getString("id");
%>
<tbody>
<tr>
<thscope="row"><%=id%></th>
<td><%=rs.getString("name")%></td>
<td><%=rs.getString("dept")%></td>
<td><%=rs.getString("join_date")%></td>
<td><%=rs.getString("address")%></td>
<td><%=rs.getString("salary")%></td>
<td><%=rs.getString("contact")%></td>
<td>
<ahref="UpdateRecord.jsp?id=<%=id%>"class="btnbtn-smbtn-
primary">Update</a>
<ahref="DeleteUser?id=<%=id%>"class="btnbtn-smbtn-dangerms-1">Delete</a>
</td></tr>
<%
}
%>
</table>
</div>
</div>
</body>
</html>
Assignment6
 UpdateRecord.jsp
<%@pageimport="java.sql.ResultSet"%>
<%@pageimport="java.sql.PreparedStatement"%>
<%@pageimport="java.sql.Connection"%>
<%@pageimport="com.conn.Databaseconnection"%>
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<metaname="viewport"content="width=device-width,initial-scale=1.0">
<metahttp-equiv="X-UA-Compatible"content="ie=edge">
<title>updaterecord</title>

<!--FontIcon-->
<linkrel="stylesheet"
href="fonts/material-icon/css/material-design-iconic-font.min.css">
<!--Maincss-->
<linkrel="stylesheet"href="css/style.css">
</head>
<body>
<%
Stringid=request.getParameter("id");
Connectioncon=Databaseconnection.getConnection();
PreparedStatementps=con.prepareStatement("SELECT*FROM`employee_detail`
WHERE id='"+id+"'");
ResultSetrs=ps.executeQuery();
if(rs.next())
{
Stringdept=rs.getString("dept");
%>
<divclass="main">
<!--Signupform-->
<sectionclass="signup">
<divclass="container">
<divclass="signup-content">
<divclass="signup-form">
<h2class="form-title">UpdateRecord</h2>
<formaction="UpdateRecord"method="post"
>
<divclass="form-group">
<input
type="hidden"name="id"id="id"value="<%=id%>"/>
</div>

<divclass="form-group">
<labelfor="name"><i
class="zmdi zmdi-account material-icons-name"></i></label><input
type="text"name="name"id="name"value="<%=rs.getString("name")%>"/>
</div>
<divclass="form-group">
<label for="Department"><i class="zmdi zmdi-tv"></i></label><input
type="text"name="dept"value="<%=rs.getString("dept")%>"id="dept"/>
</div>
<divclass="form-group">
<labelfor="join_date"><iclass="zmdizmdi-calendar"></i></label><input type="date"
name="join_date" value="<%=rs.getString("join_date")%>" id="join_date"/>
</div>
<divclass="form-group">
<labelfor="address"><iclass="zmdizmdi-swap-vertical-circle"></i></label>
<inputtype="text"name="address"id="address" value="<
%=rs.getString("address")%>"/>
</div>
<divclass="form-group">
<labelfor="salary"><iclass="zmdizmdi-balance"></i></label>
<inputtype="text"name="salary"id="salary"
value="<%=rs.getString("salary")%>" />
</div>
<divclass="form-group">
<labelfor="contact"><iclass="zmdizmdi-phone"></i></label>
<inputtype="text"name="contact"id="contact"
value="<%=rs.getString("contact")%>" />
</div>
<divclass="form-group">
<span><span></span></span>
</div>
<divclass="form-groupform-button">
<inputtype="submit"name="signup"id="signup"
class="form-submit" value="Update" />
</div>
</form>
<%}%>
</div>
<divclass="signup-image">
<figure>
<imgsrc="images/signup-image.jpg"alt="singupimage">
</figure>
<ahref="Details.jsp">ViewRecord
</a>
</div>
</div>
</div>
</section>
</div>
<!--JS-->
<scriptsrc="vendor/jquery/jquery.min.js"></script>
<scriptsrc="js/main.js"></script>
</body>
<!--ThistemplateswasmadebyColorlib(https://colorlib.com)-->
</html>

 UpdateRecord.java
package com.code;
importjava.io.IOException;
importjava.sql.Connection;
importjava.sql.PreparedStatement;

import javax.servlet.ServletConfig;
importjavax.servlet.ServletException;
importjavax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;
import com.conn.Databaseconnection;
/**
*ServletimplementationclassUpdateRecord
*/
@WebServlet("/UpdateRecord")
publicclassUpdateRecordextendsHttpServlet
{
staticConnectioncon=null;
publicvoidinit(ServletConfigconfig)throwsServletException
{
try
{
con=Databaseconnection.getConnection();
}catch(Exceptione)
{
System.out.println("Exc"+e);
}
}
protectedvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)
throws ServletException, IOException
{
Stringid=request.getParameter("id");
Stringname=request.getParameter("name");
String dept = request.getParameter("dept");
Stringjoin_date=request.getParameter("join_date");
String address = request.getParameter("address");
String salary = request.getParameter("salary");
Stringcontact=request.getParameter("contact"); try
{
PreparedStatementps=con.prepareStatement("UPDATE`employee_detail`SET
`name`='"+name+"',`dept`='"+dept+"',`join_date`='"+join_date+"',`address`='"+add
ress+"',`salary`='"+salary+"',`contact`='"+contact+"' WHERE `id`='"+id+"'");
intr=ps.executeUpdate();
if(r>0)
{
System.out.println("All Information Updated...!"); response.sendRedirect("Details.jsp?
update=done");
}
else
{
System.out.println("Update Operation Fail...!"); response.sendRedirect("Details.jsp?
fail=update");
}

}catch(Exceptione)
{
System.out.println("Exc"+e);
}
}
}
 DeleteUser.java
package com.code;
importjava.io.IOException;
importjava.sql.Connection;
importjava.sql.PreparedStatement;
import java.sql.SQLException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
importjavax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;
import com.conn.Databaseconnection;
/**
*ServletimplementationclassDeleteUser
*/
@WebServlet("/DeleteUser")
public class DeleteUser extends HttpServlet
{ privatestaticfinallongserialVersionUID=1L;
/**
*@seeServlet#init(ServletConfig)
*/
publicvoidinit(ServletConfigconfig)throwsServletException{
//TODOAuto-generatedmethodstub
}
/**
*@seeHttpServlet#doGet(HttpServletRequestrequest,HttpServletResponse
response)
*/
protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throws
ServletException, IOException
{Stringid=request.getParameter("id");
Connectioncon=Databaseconnection.getConnection();
try{
PreparedStatementps=con.prepareStatement("DELETEFROM`employee_detail` WHERE
id='"+id+"'");
inti=ps.executeUpdate();
if(i>0)
{System.out.println("DeleteDone"+id);
response.sendRedirect("Details.jsp?delete=done");
}else
{
System.out.println("Delete Fail...!");
response.sendRedirect("Details.jsp?fail=delete");
}
}catch(Exceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}
}
}
*OUTPUT
 Index page
 Registration page

 Details page
 Delete message

 Update page

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy