Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table border="1" width="30%" height="30%">
- <th><font color='#D18603'>ActivityID</font>
- <th><font color='#D18603'>Type</font></th>
- <th><font color='#D18603'>Description</font></th>
- <th><font color='#D18603'>City</font></th>
- <th><font color='#D18603'>Location</font></th>
- <th><font color='#D18603'>Date</font></th>
- <th><font color='#D18603'>Price</font></th>
- <th><font color='#D18603'>Buy</font>
- <%
- Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
- Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/users", "users", "123");
- Statement st = con.createStatement();
- ResultSet rs;
- rs = st.executeQuery("select * from activities where type='müzik'");
- while (rs.next()) {
- out.println("<tr>");
- out.println("<td>" + rs.getString("id")+"</td>");
- out.println("<td>" + rs.getString("type")+ "</td>");
- out.println("<td>" + rs.getString("description")+ "</td>");
- out.println("<td>" + rs.getString("city") + "</td>");
- out.println("<td>" + rs.getString("location")+ "</td>");
- out.println("<td>" + rs.getString("date") + "</td>");
- out.println("<td>" + rs.getString("price") + "</td>");
- out.println("<td><b><form action='reservations.jsp'><select name='buy'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select><input type='submit' value='Submit'></form></b>");
- out.println("</tr>");
- }
- st.close();
- %>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <%@ page import ="java.sql.*" %>
- <%
- String username = (String) request.getSession().getAttribute("username");
- Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
- Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/users", "users", "123");
- String sorgu = "INSERT INTO reservation(id,username,buy) VALUES ('" + request.getParameter("id") + "', '" + username + "','" + request.getParameter("buy") + "') ";
- java.sql.Statement st = con.createStatement();
- int rowNum = st.executeUpdate(sorgu);
- response.sendRedirect("paypal.html");
- st.close();
- %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement