Spring Boot测试数据库连接
@Autowired JdbcTemplate jdbcTemplate; @Test void fei3() { // 测试连接数据库 Long aLong = jdbcTemplate.queryForObject("select count(*) from user", Long.class); System.out.println("========================"); System.out.println(aLong); }
@Autowired JdbcTemplate jdbcTemplate; @Test void fei3() { // 测试连接数据库 Long aLong = jdbcTemplate.queryForObject("select count(*) from user", Long.class); System.out.println("========================"); System.out.println(aLong); }