[Relearn Spring] 5 Jdbc Support

1. JdbcTemplate is thread-safe. So a single instance of JdbcTemplate will be enough for the whole system, unless you have more than one data sources.

2. NamedParameterJdbcTemplate

  String sql = "select * from t where t.firstName = :firstName "

  You can then provider with a map —

 map.put("firstName", "xxx") 

  or a java bean  —

bean.setFirstName("xxx")

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.