This talk was supposed to explain to Demo12, the results found that the last lecture has been made very clear, so no longer described, if the reader has questions, can be published in the comments, the author will reply.
Because Demo13 is to access the database, so to do some preliminary technical introduction.
Demo13 's access to the database is through spring's jdbctemplate Way (the next demo will transform it into a hibernate way).
Here's a brief introduction to spring's JdbcTemplate:
JdbcTemplate is an encapsulation of JDBC, designed to reduce the cumbersome code of JDBC, and abstracts some common methods. The target is simple and stupid.
Make JDBC easier to use and less error phone
Framework handles the creation and release resources
Framework takes care of all exception handling
The use of JdbcTemplate requires DataSource support, so in the configuration file, a datasource configuration is required and then configured in DataSource to JdbcTemplate. The JdbcTemplate is then configured into the DAO layer, and the DAO is finally configured to the model layer.