Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page language="java" contentType="text/html; charset=windows-1255"
- pageEncoding="windows-1255"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
- <title>Toledo's Web Page</title>
- <link rel="stylesheet" type="text/css" href="CSS.css">
- <style>
- </style>
- </head>
- <body>
- <sql:setDataSource var="toledo" driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://localhost/toledo"
- user="root" password="t7417883"/>
- <sql:query dataSource="${toledo}" var="name">
- select * from users where user_name ='${param.userSelection}';
- </sql:query>
- <sql:query dataSource="${toledo}" var="speedSQL">
- select speed from users where user_name ='${param.userSelection}';
- </sql:query>
- <sql:query dataSource="${toledo}" var="voteSQL">
- select vote_num from users where user_name ='${param.userSelection}';
- </sql:query>
- <c:set var="vote_speed" value="(${param.speedSQL}*${param.voteSQL}+${param.speed_vote})/(${param.voteSQL}+1)" />
- <sql:update dataSource="${toledo}" var="result">
- update users set speed="${param.vote_speed}" where user_name ='${param.userSelection}';
- </sql:update>
- <a href="True.jsp">home page</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement