Thesis full text PDF - Politecnico di Milano
Thesis full text PDF - Politecnico di Milano
Thesis full text PDF - Politecnico di Milano
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
4 GENERAZIONE SEMI-AUTOMATICA 4.5 Generazione jsp<br />
String cognome, String facolta, String me<strong>di</strong>a){<br />
Connection con = null;<br />
Statement stmt = null;<br />
ResultSet rs = null;<br />
ArrayList empList = new ArrayList();<br />
StringBuffer resultString ;<br />
EmpBean emp;<br />
try{<br />
ServletCon<strong>text</strong> con<strong>text</strong> = servlet.getServletCon<strong>text</strong>();<br />
DataSource dataSource = (DataSource) con<strong>text</strong>.getAttribute(Action.DATA_SOURCE_KEY);<br />
con= dataSource.getConnection();<br />
stmt = con.createStatement();<br />
/** Access records from table emptable */<br />
String query=" INSERT INTO STU VALUES (’"+ matricola + "’ , ’"+ nome + "’ ,<br />
’"+ cognome + "’ , ’"+ facolta + "’ , ’"+ me<strong>di</strong>a + "’) ";<br />
int rc = stmt.executeUpdate(query);<br />
}<br />
catch ( SQLException e ) {<br />
System.err.println("SQL Exception occured while accessing the table" );<br />
e.printStackTrace();<br />
return null;<br />
}<br />
catch ( Exception e ) {<br />
e.printStackTrace();<br />
return null;<br />
}<br />
return empList;<br />
}<br />
}<br />
4.5 Generazione jsp<br />
<br />
<br />