Copilot commented on code in PR #7081:
URL: https://github.com/apache/ignite-3/pull/7081#discussion_r2567715635
##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcConnectionFailoverTest.java:
##########
@@ -143,13 +250,19 @@ void testTransactionCannotBeUsedAfterNodeRestart() throws
SQLException {
}
}
- private static Connection getConnection(int nodesCount) throws
SQLException {
+ private static Connection getConnection(int nodesCount, String ... params)
throws SQLException {
String addresses = IntStream.range(0, nodesCount)
.mapToObj(i -> "127.0.0.1:" + (BASE_CLIENT_PORT + i))
.collect(Collectors.joining(","));
+ return getConnection(addresses, params);
+ }
+
+ private static Connection getConnection(String addresses, String ...
params) throws SQLException {
+ String args = String.join("&", params);
+
//noinspection CallToDriverManagerGetConnection
- return DriverManager.getConnection("jdbc:ignite:thin://" + addresses);
+ return DriverManager.getConnection("jdbc:ignite:thin://" + addresses +
"?" + args);
Review Comment:
The URL construction will produce a trailing `?` when no parameters are
provided (e.g., `jdbc:ignite:thin://127.0.0.1:10800?`). Consider handling the
empty params case:
```java
String args = params.length == 0 ? "" : "?" + String.join("&", params);
return DriverManager.getConnection("jdbc:ignite:thin://" + addresses + args);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]