Spring DAO - first query with JdbcTemplate takes much longer time
问题 In my application I use Spring MVC with DAO pattern to access MSSql database with JdbcTemplate. Everything is working fine but I have noticed that first query takes a bit longer then next queries in each single request. I wrote a simple test: String sql = "SELECT 1"; for (int i = 0; i < 5; i++) { long startTime = System.currentTimeMillis(); jdbcTemplate.queryForList(sql); logger.debug("query took: " + TimeHelper.showDuration(startTime)); } the result is: 2012-08-28 12:55:07,665 | Start 2012