%@ page import="java.util.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.text.*" %> <% String name = request.getParameter("name"); String contact = request.getParameter("contact"); String email = request.getParameter("email"); int numSessions = Integer.parseInt(request.getParameter("numSessions")); int locationValue = 0; String locationName = ""; 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 rs = null; stmt.executeUpdate( "INSERT INTO studies (id, name, contactName, contactEmail, active, creditHours) VALUES (studies_id_seq.nextval,'" + name + "', '" + contact + "', '" + email + "'," + "1," + "1" + ")" ); rs = stmt.executeQuery("SELECT MAX(id) FROM studies"); rs.next(); int studyID = rs.getInt(1); rs = stmt.executeQuery("SELECT * FROM locations"); ArrayList locationNamesList = new ArrayList(); ArrayList locationIDsList = new ArrayList(); while (rs.next()) { locationIDsList.add(new Integer(rs.getInt("ID"))); locationNamesList.add(new String(rs.getString("name"))); } /* int locationIDs[] = new int[locationIDsList.size()]; String locationNames[] = new String[locationNamesList.size()]; for (int j = 0; j < locationIDsList.size(); j++) { locationIDs[j] = locationIDsList.get(j).intValue(); locationNames[j] = locationNamesList.get(j); } */ %>