Hello, I have a small table that I want to load into memory in the form of List<Country> , so as not to pull the database. But ... how to do it right?
DataSource is:
@Configuration public class DataSourceConfig { @Value("${jdbc.url}") private String url; @Value("${jdbc.username}") private String username; @Value("${jdbc.password}") private String password; @Bean public DataSource dataSource() { HikariDataSource dataSource = new HikariDataSource(); dataSource.setDriverClassName("com.mysql.jdbc.Driver"); dataSource.setJdbcUrl(url); dataSource.setUsername(username); dataSource.setPassword(password); dataSource.setMaximumPoolSize(10); return dataSource; } @Bean public Sql2o sql2o() { return new Sql2o(dataSource()); } }