June 2018
Intermediate to advanced
408 pages
11h 23m
English
To overcome the preceding problems with core JDBC, Spring Framework provides excellent database integration with the Spring JDBC module. Spring JDBC provides the JdbcTemplate class, which helps us to remove the plumbing code, and also helps the developer to concentrate only on the SQL query and parameters. We just need to configure the JdbcTemplate with a dataSource and write code like this:
jdbcTemplate = new JdbcTemplate(dataSource);int count = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM CUSTOMER", Integer.class);
As we saw in the previous example, Spring provides a simplification for handling database access by using the JDBC template. The JDBC template uses core JDBC code internally and provides ...
Read now
Unlock full access