Advertisement
GameNCode

Updater SQL JSP

Mar 19th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=windows-1255" pageEncoding="windows-1255"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  4. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  5.  
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
  9. <link rel="stylesheet" type="text/css" href="Style.css">
  10. <title>Database Usage</title>
  11. </head>
  12. <body>
  13. <img src="${pageContext.request.contextPath}/images/pen.jpg" height = "500px" width = "1000px" align = "middle"/>
  14. <a name="home"></a>
  15. <ul>
  16. <li><a href="#">Home</a></li>
  17. <li><a href="#news">News</a></li>
  18. <li><a href="ContactUs.jsp">Contact</a></li>
  19. <li><a href="#about">About</a></li>
  20. <li><a href="Signup.jsp">Sign Up</a></li>
  21. </ul>
  22. <sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
  23. url="jdbc:mysql://localhost/userdb"
  24. user="root" password="Royboy007"/>
  25. <sql:query dataSource="${snapshot}" var="result">
  26. SELECT * FROM members where user ='<%=session.getAttribute("user")%>';
  27. </sql:query>
  28. <sql:update dataSource="${snapshot}" var="update">
  29. UPDATE members SET user = "<%= request.getParameter("uname") %>" , pass = "<%= request.getParameter("pass") %>",email = "<%= request.getParameter("mail") %>" , wallet = "<%= request.getParameter("wallet") %>" where user = "<%= session.getAttribute("user") %>";
  30. </sql:update>
  31. </form>
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement