class UserController {

    @GetMapping("batchSave")
    public String batchSaveUser()throws Exception  {
        String sql =
                "INSERT INTO user (USERNAME,PASSWORD) VALUES (?,?)";
        List<Object[]> arrayList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            String[] arr = new String[2];
            arr[0] = "longzhiran" + i;
            arr[1] = "123456" + i;
            arrayList.add(arr);
        }
        jdbcTemplate.batchUpdate(sql, arrayList);
        return "执行成功";
    }

}