<%@ page import="java.util.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.text.*" %> <% int studyID = Integer.parseInt(request.getParameter("studyID")); int sessionID = Integer.parseInt(request.getParameter("sessionID")); int classSection = Integer.parseInt(request.getParameter("classSection")); int PID = Integer.parseInt(request.getParameter("PID")); String dateString = request.getParameter("sessionDate"); String timeString = request.getParameter("sessionTime"); String studyName = request.getParameter("studyName"); String location = ""; String description = ""; int id = 0; Class.forName ("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection("jdbc:oracle:thin:@dbprod03.isis.unc.edu:1521:ord1p", "acrystal", "&GJ8$mRQ"); Statement stmt = con.createStatement(); ResultSet checkPIDrs = null, rs = null; // NEED TO CHECK FOR PID IN DATABASE checkPIDrs = stmt.executeQuery("SELECT PID FROM participants WHERE PID = " + PID); if (!checkPIDrs.next()) response.sendRedirect("invalidPID.jsp"); rs = stmt.executeQuery("SELECT name FROM locations WHERE id = (SELECT locationID FROM sessions WHERE id = " + sessionID + ")"); if (rs.next()) location = rs.getString("name"); else location = "Unknown."; // need to check if this is a change of session, and update accordingly rs = stmt.executeQuery("SELECT id FROM sessions_participants_link WHERE sessionID IN (SELECT id FROM sessions WHERE studyID = " + studyID + ") AND PID = " + PID); if (rs.next()) // found them in the table stmt.executeUpdate("UPDATE sessions_participants_link SET sessionID = " + sessionID + " WHERE id = " + rs.getInt("id")); else stmt.executeUpdate("INSERT INTO sessions_participants_link (id, PID, sessionID) VALUES (splink_id_seq.nextval," + PID + ", " + sessionID + ")"); %> StudyManager: Thank you

Thank you for participating!

You have signed up for the following session:

Study name:
<%= studyName %>

Session date and time:
<%= dateString %>
<%= timeString %>

Session location:
<%= location %>


Please make a note of the date, time and location of your session. We'll send you a reminder email the day before your session.

Please arrive promptly. Study sessions start on time, and latecomers can't be admitted once the procedure is under way. Bring a pen to complete the questionnaires, and a book or magazine to read during waiting times.

If you need to change into a different session, simply return to StudyManager and sign up again. Your original session request will be deleted and replaced with whichever session you choose.

<% con.close(); %>