![верстка](https://habrastorage.org/r/w120/webt/5a/82/35/5a823567cb671242225007.png)
Вёрстка
- 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();
}