You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The version should be returned. Using the connection object to fetch version() using a prepared statement works fine.
Code example
container =
newClickHouseContainer("clickhouse/clickhouse-server:22.2");
container.start();
try (varc = container.createConnection("?")) {
// executing the version fetch like this worksvarr = c.prepareStatement("SELECT version() as server_version").executeQuery();
r.next();
varv = r.getString("server_version");
System.out.println(v);
// this failsvarv2 = c.getMetaData().getDatabaseMajorVersion();
System.out.println(v2);
}
Error log
Caused by: java.sql.SQLException: Failed to retrieve server version.
at com.clickhouse.jdbc.ConnectionImpl.lambda$getServerVersion$0(ConnectionImpl.java:103)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at com.clickhouse.jdbc.ConnectionImpl.getServerVersion(ConnectionImpl.java:103)
at com.clickhouse.jdbc.metadata.DatabaseMetaData.getDatabaseMajorVersion(DatabaseMetaData.java:1188)
Configuration
Environment
Client version: jdbc 2
Language version: java 21
OS: linux
ClickHouse server
ClickHouse Server version: 22.2.3.1
The text was updated successfully, but these errors were encountered:
The database metadata object is throwing exceptions when fetching the server version.
Steps to reproduce
connection.getMetadata().getDatabaseMajorVersion()
Expected behaviour
The version should be returned. Using the connection object to fetch
version()
using a prepared statement works fine.Code example
Error log
Configuration
Environment
ClickHouse server
The text was updated successfully, but these errors were encountered: