Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public class ClickHouseDriver implements java.sql.Driver {
}

public ClickHouseDriver() {
// log.debug("Creating a new instance of the 'proxy' ClickHouseDriver");
log.info("ClickHouse JDBC driver version: {}", ClickHouseDriver.class.getPackage().getImplementationVersion());
log.debug("ClickHouse JDBC driver version: {}", ClickHouseDriver.class.getPackage().getImplementationVersion());
urlFlagSent = false;
this.driver = getDriver(null);
}
Expand Down Expand Up @@ -52,21 +51,21 @@ public boolean isV2(String url) {
log.debug("Checking if V1 driver is requested. V2 is the default driver.");
boolean v1Flag = Boolean.parseBoolean(System.getProperty("clickhouse.jdbc.v1", "false"));
if (v1Flag) {
log.info("V1 driver is requested through system property.");
log.debug("V1 driver is requested through system property.");
return false;
}

if (url != null && url.contains("clickhouse.jdbc.v")) {
urlFlagSent = true;

if (url.contains("clickhouse.jdbc.v1=true")) {
log.info("V1 driver is requested through URL.");
log.debug("V1 driver is requested through URL.");
return false;
} if (url.contains("clickhouse.jdbc.v2=false")) {
log.info("V1 driver is requested through URL.");
log.debug("V1 driver is requested through URL.");
return false;
} else {
log.info("V2 driver is requested through URL.");
log.debug("V2 driver is requested through URL.");
return true;
}
}
Expand All @@ -81,10 +80,10 @@ private java.sql.Driver getDriver(String url) {
}

if (isV2(url)) {
log.info("v2 driver");
log.debug("v2 driver");
driver = new com.clickhouse.jdbc.Driver();
} else {
log.info("v1 driver");
log.debug("v1 driver");
driver = new DriverV1();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static String getFrameworksDetected() {

public static void load() {
try {
log.info("Registering ClickHouse JDBC driver v1 ({})", driverVersion);
log.debug("Registering ClickHouse JDBC driver v1 ({})", driverVersion);
DriverManager.registerDriver(new DriverV1());
} catch (SQLException e) {
throw new IllegalStateException(e);
Expand All @@ -120,7 +120,7 @@ public static void load() {

public static void unload() {
try {
log.info("Unregistering ClickHouse JDBC driver v1 ({})", driverVersion);
log.debug("Unregistering ClickHouse JDBC driver v1 ({})", driverVersion);
DriverManager.deregisterDriver(new DriverV1());
} catch (SQLException e) {
throw new IllegalStateException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class ConnectionImpl implements Connection, JdbcV2Wrapper {

public ConnectionImpl(String url, Properties info) throws SQLException {
try {
log.debug("Creating connection to {}", url);
this.url = url;//Raw URL
this.config = new JdbcConfiguration(url, info);
this.onCluster = false;
Expand Down
2 changes: 1 addition & 1 deletion jdbc-v2/src/main/java/com/clickhouse/jdbc/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static String getFrameworksDetected() {
log.debug("Initializing ClickHouse JDBC driver V2");

driverVersion = ClickHouseClientOption.readVersionFromResource("jdbc-v2-version.properties");
log.info("ClickHouse JDBC driver version: {}", driverVersion);
log.debug("ClickHouse JDBC driver version: {}", driverVersion);

int tmpMajorVersion;
int tmpMinorVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ public ResultSet getProcedureColumns(String catalog, String schemaPattern, Strin
*/
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
log.info("getTables: catalog={}, schemaPattern={}, tableNamePattern={}, types={}", catalog, schemaPattern, tableNamePattern, types);
log.debug("getTables: catalog={}, schemaPattern={}, tableNamePattern={}, types={}", catalog, schemaPattern, tableNamePattern, types);
// TODO: when switch between catalog and schema is implemented, then TABLE_SCHEMA and TABLE_CAT should be populated accordingly
// String commentColumn = connection.getServerVersion().check("[21.6,)") ? "t.comment" : "''";
// TODO: handle useCatalogs == true and return schema catalog name
Expand Down