文章目录
刚毕业入职,最近在学Spring Boot,照着demo敲代码的时候发现一些问题,就想记录一下,当作CSDN上的第一篇博客吧。
在学使用JdbcTemplate操作MySQL的时候,代码如下,编译不通过。
@Repository
public class UserRepositoryImpl implements UserRepository {
private final JdbcTemplate jdbcTemplate;
...
}
然后发现是jdbcTemplate没有注入,于是加上@Autowired,但是加上了还是不行,原因是@Autowired注解