@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();
}