@Bean
public DataSource sphinxDataSource() {
HikariDataSource dataSource = new HikariDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setJdbcUrl(sphinxUrl);
dataSource.setUsername("");
dataSource.setPassword("");
dataSource.setMaximumPoolSize(1);
return dataSource;
}
@Bean
public JdbcTemplate sphinxJdbcTemplate() throws SQLException, ClassNotFoundException {
return new JdbcTemplate(sphinxDataSource());
}
List<Integer> results = jdbcTemplate.query(
"SELECT id FROM Book LIMIT 10",
new RowMapper<Integer>() {
@Override
public Integer mapRow(ResultSet rs, int rowNum) throws SQLException {
return new Integer(rs.getInt("id"));
}
});
javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 30,024 milliseconds ago. The last packet sent successfully to the server was 30,024 milliseconds ago.
А вопрос в том как в CustomHandshakeHandler вернуть этот самый SessionId возможно другой класс нужно даже наследовать, сам не знаю и нагуглить не получилось