-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasave.jsp
More file actions
32 lines (28 loc) · 1.08 KB
/
Copy pathasave.jsp
File metadata and controls
32 lines (28 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<%
try {
String username = request.getParameter("username");
String userpass = request.getParameter("userpass");
String dateofbirth = request.getParameter("dob");
String dateofjoining = request.getParameter("doj");
String salary = request.getParameter("salary");
String branch = request.getParameter("branch");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "system", "shonu123");
PreparedStatement ps = con.prepareStatement(
"insert into payregister(username,userpass,branch,dateofjoining,dateofbirth,salary) values(?,?,?,?,?,?)");
//ps.setInt(1,2);
ps.setString(1, username);
ps.setString(2, userpass);
ps.setString(3, branch);
ps.setString(4, dateofbirth);
ps.setString(5, dateofjoining);
ps.setString(6, salary);
int s = ps.executeUpdate();
System.out.print(s);
} catch (SQLException e2) {
e2.printStackTrace();
}
%>
<jsp:forward page="ahome.jsp"></jsp:forward>