springboot- JdbcTemplate

在pom.xml加入jdbcTemplate的依賴 那麼只需要在需要使用的類中加入: @Resource private JdbcTemplate jdbcTemplate; 聲明dao類爲:@Repository,引入JdbcTemplate public Demo getById(long id){ String sql = "select *from Demo where id=?"; Ro
相關文章
相關標籤/搜索