Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <%@ page language="java" contentType="text/html; charset=windows-1255"
  2. pageEncoding="windows-1255"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
  9. <title>Toledo's Web Page</title>
  10. <link rel="stylesheet" type="text/css" href="CSS.css">
  11. <style>
  12.  
  13. </style>
  14. </head>
  15. <body>
  16. <sql:setDataSource var="toledo" driver="com.mysql.jdbc.Driver"
  17. url="jdbc:mysql://localhost/toledo"
  18. user="root" password="t7417883"/>
  19.  
  20.  
  21. <sql:query dataSource="${toledo}" var="name">
  22. select * from users where user_name ='${param.userSelection}';
  23. </sql:query>
  24.  
  25. <sql:query dataSource="${toledo}" var="speedSQL">
  26. select speed from users where user_name ='${param.userSelection}';
  27. </sql:query>
  28. <sql:query dataSource="${toledo}" var="voteSQL">
  29. select vote_num from users where user_name ='${param.userSelection}';
  30. </sql:query>
  31. <c:set var="vote_speed" value="(${param.speedSQL}*${param.voteSQL}+${param.speed_vote})/(${param.voteSQL}+1)" />
  32.  
  33. <sql:update dataSource="${toledo}" var="result">
  34. update users set speed="${param.vote_speed}" where user_name ='${param.userSelection}';
  35. </sql:update>
  36.  
  37.  
  38. <a href="True.jsp">home page</a>
  39.  
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement