Skip to content

Commit e9459ae

Browse files
committed
fix setting default database
1 parent decd223 commit e9459ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/JdbcConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private void initProperties(String url, Properties providedProperties) {
111111
String[] pathElements = path.split("([\\/]+)+", 3);
112112
if (pathElements.length > 2) {
113113
throw new IllegalArgumentException("There can be only one URL path element indicating a database name");
114-
} else if (pathElements.length == 2) {
114+
} else if (pathElements.length == 2 && pathElements[1] != null && !pathElements[1].trim().isEmpty()) {
115115
providedProperties.put(ClientConfigProperties.DATABASE.getKey(), pathElements[1]);
116116
}
117117
}

0 commit comments

Comments
 (0)