读书人

[Relearn Spring] 五 Jdbc Support

发布时间: 2012-10-13 11:38:17 作者: rapoo

[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")

读书人网 >其他数据库

热点推荐