@SpringBootApplication public class H2Application { public static void main(String[] args) { SpringApplication.run(H2Application.class, args); } @Bean CommandLineRunner init (StudentRepo studentRepo){ return args -> { List names = Arrays.asList("udara", "sampath"); names.forEach(name -> studentRepo.save(new Student(name))); }; } }