Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"%>
- <%@page import="java.sql.*" %>
- <%@page import="java.io.*" %>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="ISO-8859-1">
- <title>Insert title here</title>
- </head>
- <body>
- String name=request.getParameter("name");
- String pass=request.getParameter("password");
- <% try
- {
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost/dave","root"," ");
- Statement st=con.createStatement();
- out.println(con);
- int i = st.executeUpdate("insert into login values('"+name+"','"+pass+"')");
- out.println(i);
- out.println("Row Updated");
- response.sendRedirect("view.jsp");
- }
- %>
- catch(Exception e)
- {
- e.printStackTrace();
- }
- </body>
- </html>
Add Comment
Please, Sign In to add comment