You are on page 1of 2

Front end_ implementation

Insertion code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html, charset=UTF¬8">
<title>JSP Page</title>
<style type = "text/css" media = "all">
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px,
} </style>
<h1></h1>
<%@page
import="java.sql.*,java.util.Scanner"%> <%!
static Connection con;
%>

<%
ResultSet rs;
try{
Class.forName("oracle.jdbc.OracleDriver");
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","yapa",
"p");
con.setAutoCommit(false);
PreparedStatement pst=con.prepareStatement("insert into customer
values(?,?,?,?,?)");
String user=request.getParameter("user");
String name=request.getParameter("name");
int
mobno=Integer.parseInt(request.getParameter("mobno"));
String email=request.getParameter("email"); String
passwd=request.getParameter("pass");
pst.setString(1,user);
pst.setString(2,name);
pst.setlnt(3,mobno);
pst.setString(4,emai1);
pst.setString(5,passwd);
pst.executeQuery();
response.sendRedirect("login.html");
con.commit();
pst.close();
con.close();
}
catch(Exception e){
out.println(e);
}%>
</body>
</html>

You might also like