diff --git a/benchmarks/README.md b/benchmarks/README.md index 16aa251ca..1d4a9d75c 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -7,5 +7,5 @@ The benchmarks do not measure the performance of target JDBC drivers nor the per ## Usage 1. Build the benchmarks with the following command `../gradlew jmhJar`. 1. the JAR file will be outputted to `build/libs` -2. Run the benchmarks with the following command `java -jar build/libs/benchmarks-1.0.1-jmh.jar`. +2. Run the benchmarks with the following command `java -jar build/libs/benchmarks-1.0.2-jmh.jar`. 1. you may have to update the command based on the exact version of the produced JAR file diff --git a/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java b/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java index 99a4bd41a..cfddbef90 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java +++ b/wrapper/src/main/java/software/amazon/jdbc/util/ConnectionUrlParser.java @@ -142,7 +142,7 @@ public static String parsePasswordFromUrl(String url) { // Get the properties from a given url of the generic format: // "protocol//[hosts][/database][?properties]" public static void parsePropertiesFromUrl(String url, Properties props) { - String[] urlParameters = url.split("\\?", 1); + String[] urlParameters = url.split("\\?", 2); if (urlParameters.length == 1) { return; } diff --git a/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java b/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java index 89000a5a4..505615916 100644 --- a/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java +++ b/wrapper/src/test/java/integration/refactored/container/tests/HikariTests.java @@ -75,7 +75,8 @@ public class HikariTests { @TestTemplate public void testOpenConnectionWithUrl() throws SQLException { final HikariDataSource dataSource = new HikariDataSource(); - dataSource.setJdbcUrl(ConnectionStringHelper.getWrapperUrl() + "?wrapperPlugins=\"\""); + final String url = ConnectionStringHelper.getWrapperUrl(); + dataSource.setJdbcUrl(url + (url.contains("?") ? "&" : "?") + "wrapperPlugins=\"\""); dataSource.setUsername(TestEnvironment.getCurrent().getInfo().getDatabaseInfo().getUsername()); dataSource.setPassword(TestEnvironment.getCurrent().getInfo().getDatabaseInfo().getPassword()); dataSource.addDataSourceProperty(PropertyDefinition.PLUGINS.name, ""); diff --git a/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java b/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java index 1b1b814d3..8ea49b707 100644 --- a/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java +++ b/wrapper/src/test/java/software/amazon/jdbc/util/ConnectionUrlParserTest.java @@ -86,7 +86,7 @@ void testEncodedParams(final String url, final String expected) { void testParsingUrlsWithQuestionMarks(final String url, final String expected) { Properties props = new Properties(); ConnectionUrlParser.parsePropertiesFromUrl(url, props); - assertEquals(props.getProperty("param"), expected); + assertEquals(expected, props.getProperty("param")); } private static Stream testGetHostsFromConnectionUrlArguments() { diff --git a/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle b/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle index 1534e3bd2..54925fa51 100644 --- a/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle +++ b/wrapper/src/test/resources/hibernate_files/hibernate-core.gradle @@ -61,7 +61,7 @@ dependencies { transitive = true } testImplementation "joda-time:joda-time:2.3" - testImplementation files('/app/libs/aws-advanced-jdbc-wrapper-1.0.1.jar') + testImplementation files('/app/libs/aws-advanced-jdbc-wrapper-1.0.2.jar') testImplementation dbLibs.postgresql testImplementation dbLibs.mysql testImplementation dbLibs.h2 diff --git a/wrapper/src/test/resources/hibernate_files/java-module.gradle b/wrapper/src/test/resources/hibernate_files/java-module.gradle index c1de5759e..5c56f57eb 100644 --- a/wrapper/src/test/resources/hibernate_files/java-module.gradle +++ b/wrapper/src/test/resources/hibernate_files/java-module.gradle @@ -97,7 +97,7 @@ dependencies { // Since both the DB2 driver and HANA have a package "net.jpountz" we have to add dependencies conditionally // This is due to the "no split-packages" requirement of Java 9+ - testRuntimeOnly files('/app/libs/aws-advanced-jdbc-wrapper-1.0.1.jar') + testRuntimeOnly files('/app/libs/aws-advanced-jdbc-wrapper-1.0.2.jar') testRuntimeOnly dbLibs.mysql if ( db.startsWith( 'db2' ) ) {