M
M
Mark Ivanych2018-02-19 20:20:33
Java
Mark Ivanych, 2018-02-19 20:20:33

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.

From the console Works as expected. Tell me what kind of nonsense is not clear? 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

2 answer(s)
P
Puma Thailand, 2018-02-19
@opium

Roll back a version

M
Mark Ivanych, 2018-02-21
@iormark

Sphinx has nothing to do with it. I turned on the logs

<logger name="org.springframework.jdbc.core" level="DEBUG" />

After that, the warning began to appear
And JdbcTemplate broke on this. A tricky trick and inattention when reading logs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question