Closed HanYoonSoo closed 9 months ago
Hi, you need to specify right connection url, like this jdbc:clickhouse://localhost:8123/datasets
you can check the example project https://github.com/pelenthium/spring-clickhouse-example/blob/main/jdbc/src/main/resources/application.properties
MyCode: spring: datasource: driver-class-name: com.clickhouse.jdbc.ClickHouseDriver url: jdbc:clickhouse://localhost:8123/test_db username: root password: rootroot
Error: Caused by: org.hibernate.HibernateException: Unable to determine Dialect without JDBC metadata (please set 'javax.persistence.jdbc.url', 'hibernate.connection.url', or 'hibernate.dialect')
This is my code.. I ran Clickhouse in Docker and Connection url seems to be correct.
This project make a Jdbc dialect for Spring Data JDBC, and you told about Hibernate Dialect, it's not the same.
but you can specify
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
to work with Hibernate, because Clickhouse is Mysql compatible
Oh, it worked. Thank you!! I change driver
Before: ru.yandex.clickhouse.ClickHouseDriver
After: com.clickhouse.jdbc.ClickHouseDriver
and it was successful. What is the exact reason?
I don't know what the reason is, maybe it's because ru.yandex.clickhouse.ClickHouseDriver is too old and now this class is depricated
Note: ru.yandex.clickhouse.ClickHouseDriver and everything under ru.yandex.clickhouse will be removed starting from 0.4.0.
Hello! How do I create an application.yml for Clickhouse? The Dialect related error continues to appear.