Skip to content

Commit bffb301

Browse files
committed
some code cleanup
1 parent e373707 commit bffb301

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,11 @@ private Map<String, String> parseUrl(String url) throws SQLException {
209209
// Example: "sales/db" -> httpPath="/sales", database="db"
210210
// Example: "api/v1/clickhouse/mydb" -> httpPath="/api/v1/clickhouse", database="mydb"
211211
httpPath = "/" + pathWithoutLeadingSlash.substring(0, lastSlashIndex);
212-
try {
213-
database = URLDecoder.decode(pathWithoutLeadingSlash.substring(lastSlashIndex + 1), StandardCharsets.UTF_8.name());
214-
} catch (UnsupportedEncodingException e) {
215-
throw new SQLException("Failed to decode database name", e);
216-
}
212+
database = URLDecoder.decode(pathWithoutLeadingSlash.substring(lastSlashIndex + 1), StandardCharsets.UTF_8);
217213
} else {
218214
// No slash found (lastSlashIndex == -1), so it's a single segment representing the database name.
219215
// Example: "mydb" -> httpPath="", database="mydb"
220-
try {
221-
database = URLDecoder.decode(pathWithoutLeadingSlash, StandardCharsets.UTF_8.name());
222-
} catch (UnsupportedEncodingException e) {
223-
throw new SQLException("Failed to decode database name", e);
224-
}
216+
database = URLDecoder.decode(pathWithoutLeadingSlash, StandardCharsets.UTF_8);
225217
}
226218
}
227219

0 commit comments

Comments
 (0)