Answer the question
In order to leave comments, you need to log in
SphinxQl, Spring, Jdbc-connector is something wrong?
Hello, I use Sphinx 2.2.11 in a Docker container,
mysql-connector-java - 5.1.38
listen = 9306: mysql41
mysql_version_string = 5.0.37
Everything worked, and apparently the container redeployed, the Sphinx version may have been updated xs ...
Everything fell off ...
@Bean(name = "sphinxJdbc")
public JdbcTemplate sphinxJdbcTemplate() throws SQLException, ClassNotFoundException {
return new JdbcTemplate(sphinxDataSource());
}
@Bean
public DataSource sphinxDataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setUsername("");
dataSource.setPassword("");
dataSource.setUrl("jdbc:mysql://172.19.0.1:9306?characterEncoding=utf8&maxAllowedPacket=512000");
dataSource.setMaxTotal(2);
dataSource.setMaxWaitMillis(8000);
dataSource.setPoolPreparedStatements(true);
dataSource.setMaxOpenPreparedStatements(10);
return dataSource;
}
sphinxJdbc.queryForObject("SELECT rating FROM Book LIMIT 1", Integer.class);
org.springframework.dao.TransientDataAccessResourceException: StatementCallback; SQL [SELECT rating FROM Book LIMIT 1]; ResultSet is from UPDATE. No Data.; nested exception is java.sql.SQLException: ResultSet is from UPDATE. no data.
mysql -h172.19.0.1 -P9306
SELECT rating AS sder FROM Book LIMIT 1
Answer the question
In order to leave comments, you need to log in
Sphinx has nothing to do with it. I turned on the logs
<logger name="org.springframework.jdbc.core" level="DEBUG" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question