April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Spring DAO: JDBC
nClass library offers simpler programming model than raw JDBC
nTwo flavours of usage:
nCallbacks (JdbcTemplate)
nJDBC objects: Model queries, updates and stored procedures as objects
nNo more try/catch/finally blocks
nNo more leaked connections
nSpring will always close a connection: no scope for programmer error
nMeaningful exception hierarchy
nNo more vendor code lookups
nSpring autodetects database and knows what Oracle, DB2 error codes mean
nMore portable code
nMore readable code
ncatch (BadSqlGrammarException ex)
nStored procedure support
nCan refactor to clean up JDBC without adopting Spring overall
nIncremental adoption: Step by step