Вёрстка
- 1 ответ
- 0 вопросов
0
Вклад в тег
@Bean
public DataSource sphinxDataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setUsername("");
dataSource.setPassword("");
dataSource.setUrl(sphinxUrl);
return dataSource;
}
@Bean
public JdbcTemplate sphinxJdbcTemplate() throws SQLException, ClassNotFoundException {
return new JdbcTemplate(sphinxDataSource());
}
@Bean
public Connection sphinxJdbc() throws SQLException, ClassNotFoundException {
return sphinxDataSource().getConnection();
}