D
D
DDwrt1002019-07-22 10:22:11
Java
DDwrt100, 2019-07-22 10:22:11

Why is the database connection not working on Windows?

Good afternoon, please help me understand why this happens.
I have a Spring project with two databases. The first is Postgress, the second is ClickHouse.
All this is developed under openjdk.
Initially, the development was carried out on a Linux machine, working with the ClickHouse database worked.
After, for a number of reasons, I had to transfer development to a Windows 10 machine.
At the same time, the connection to the database stopped working, when you try to make a request, it drops out in trace

2019-07-22 10:16:45.840  WARN 9852 --- [nio-8080-exec-1] com.zaxxer.hikari.HikariConfig           : HikariPool-2 - maxLifetime is less than 30000ms, setting to default 1800000ms.
2019-07-22 10:16:45.840  INFO 9852 --- [nio-8080-exec-1] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Starting...
2019-07-22 10:16:45.866  INFO 9852 --- [nio-8080-exec-1] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Start completed.
2019-07-22 10:16:46.419  WARN 9852 --- [nio-8080-exec-1] o.s.jdbc.support.SQLErrorCodesFactory    : Error while extracting database name - falling back to empty error codes

org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLFeatureNotSupportedException
  at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:331) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:356) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:214) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:136) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:99) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:122) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1442) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:387) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:451) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:461) ~[spring-jdbc-5.1.7.RELEASE.jar:5.1.7.RELEASE]
  at ru.stcnet.sla.db.ClickHouse.DAO.ClickHouseDAO.query(ClickHouseDAO.java:31) ~[classes/:na]
  at ru.stcnet.sla.db.ClickHouse.Service.ClickHouseService.giveall(ClickHouseService.java:26) ~[classes/:na]

If you compile the project into a Jar and put it on a Linux machine, all queries with the database work.
If this Jar is transferred to a Win machine, then we get a 500 error.
What can be wrong ?
UPD. I was able to fix it, but to be honest, in a crutch way. Switched to the official Http driver instead of the binary one. Everything has been fixed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaonosos, 2019-11-18
@yaonosos

I'm not an expert, but the port may be occupied by another program.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question