Skip to content

Commit 35d7088

Browse files
authored
fix: avoid encoding MariaDB connection properties (#1237)
1 parent dca6af4 commit 35d7088

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200).
55

6+
### :bug: Fixed
7+
- Avoid encoding MariaDB connection properties ([PR #1237](https://github.com/aws/aws-advanced-jdbc-wrapper/pull/1237)).
8+
69
## [2.5.4] - 2024-12-23
710
### :bug: Fixed
811
- Avoid setting ignoreNewTopologyRequestsEndTimeNano on initial connection ([PR #1221](https://github.com/aws/aws-advanced-jdbc-wrapper/pull/1221)).

wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlBuilder.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
package software.amazon.jdbc.util;
1818

19-
import java.io.UnsupportedEncodingException;
20-
import java.net.URLEncoder;
21-
import java.nio.charset.StandardCharsets;
2219
import java.sql.SQLException;
2320
import java.util.Enumeration;
2421
import java.util.Properties;
@@ -95,16 +92,10 @@ public static String buildUrl(final String jdbcProtocol,
9592
queryBuilder.append("&");
9693
}
9794
final String propertyValue = copy.getProperty(propertyName);
98-
try {
99-
queryBuilder
100-
.append(propertyName)
101-
.append("=")
102-
.append(URLEncoder.encode(propertyValue, StandardCharsets.UTF_8.toString()));
103-
} catch (final UnsupportedEncodingException e) {
104-
throw new SQLException(
105-
Messages.get("ConnectionUrlBuilder.failureEncodingConnectionUrl"),
106-
e);
107-
}
95+
queryBuilder
96+
.append(propertyName)
97+
.append("=")
98+
.append(propertyValue);
10899
}
109100
}
110101

wrapper/src/main/resources/aws_advanced_jdbc_wrapper_messages.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ ConnectionProvider.unsupportedHostSpecSelectorStrategy=Unsupported host selectio
103103

104104
# Connection Url Builder
105105
ConnectionUrlBuilder.missingJdbcProtocol=Missing JDBC protocol and/or host name. Could not construct URL.
106-
ConnectionUrlBuilder.failureEncodingConnectionUrl=Failed to encode connectionURL properties.
107106

108107
# Connection Url Parser
109108
ConnectionUrlParser.protocolNotFound=Url should contain a driver protocol. Protocol is not found in url: ''{0}''

0 commit comments

Comments
 (0)