Answer the question
In order to leave comments, you need to log in
Spring and SphinxSearch how to use?
Hello, I do not understand how to use it correctly.
Works,
@Bean
public Connection sqlSphinx() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection(sphinxUrl, "", "");
return conn;
}
Answer the question
In order to leave comments, you need to log in
In general, I was confused by Hikari, Shinx does not work with him.
But commons-dbcp2 works fine)
@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();
}
you are using a regular muscle driver,
respectively, read the spring muscle docks,
it seems to me that you can already raise the pool in it by default
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question