第一個 JdbcTemplate 啟動應用程式
@SpringBootApplication
@RestController
public class SpringBootJdbcApplication {
@Autowired
private JdbcTemplate template;
@RequestMapping("/cars")
public List<Map<String,Object>> stocks(){
return template.queryForList("select * from car");
}
public static void main(String[] args) {
SpringApplication.run(SpringBootJdbcApplication.class, args);
}
}