Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Persistência@Repository Spring @Stateless JavaEEpublic class Spring vs. Java EE QConSP 2012

31,662 views

Published on

Persistência@Repository Spring @Stateless JavaEEpublic class ContatoDAO { public class ContatoDAO { @Autowired @Resource private JdbcTemplate template; private DataSource ds; public void salva(Contato c){ public void salva(Contato c) { try { template.update( Connection con = ds.getConn..(); "insert ... values (?, ?)", PreparedStatement ps = c.nome(), c.idade()); con.prepareStatement(“insert ..”); } ps.setString(1, c.nome());} ps.setString(1, c.idade()); ps.execute(); ps.close(); }catch(..){} ...QCONSP #3 ROUND #2

Published in: Technology, Education

×