Ciao a tutti ho un grosso problema che non riesco a risolvere, devo fare una statistica che mi dice quanti studenti si sono iscritti ad un appello X in data Z...Questo metodo mi stampa una tabella con tre colonne:
NOME_CORSO || DATA || SCELTA
scelta sono i bottoni radio che mi permetto di scegliere un corso e una data (d'esame)....
Il metodo che mi esegue questo è il seguente:
Ora non riesco a far capire quando premo il pulsante CONFERMA a prelevare in base alla scelta del radio il nome del corso e la sua data corrispondente....codice:public String elencoAppelli() { String ris = "ELENCO APPELLI " + "<table width=\"300\" height=\"80\" border = \"1\">" + "<thead> <tr> <td> Corso </td> " + "<td> Data </td> " + "<td> Scelta </td> " + "</tr> </thead>"; try { String controllo = "SELECT NOME_CORSO, DATA" + " FROM TABELLA_CORSI, TABELLA_APPELLI" + " WHERE (TABELLA_APPELLI.ID_CORSO = TABELLA_CORSI.ID_CORSO)"; Connection c = DriverManager.getConnection(url,user,pwd); Statement st = c.createStatement(); ResultSet rs = st.executeQuery(controllo); while(rs.next()) { ris += "<tr> <td>"+ rs.getString("NOME_CORSO")+"</td>"+ "<td>"+ rs.getString("DATA")+"</td>" + "<td><input type=\"radio\" name=\"scelta\" value=" + i++ +"checked=\"true\" /></td>" + "</tr>"; } rs.close(); st.close(); c.close(); } catch(SQLException ecc) { System.out.println(ecc.getMessage()); } return ris + "</table>"; }
Grazie mille
Ciao

Rispondi quotando


