Skip to content

Commit 9883c97

Browse files
Fix #231: remove url encoding for DB2 (#234)
* so that username and password are properly transmitted to the drive * provide same behavior as Spring SAR/ SCS connector: spring-cloud/spring-cloud-connectors@a8eef2b
1 parent f3ade51 commit 9883c97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

java-cfenv-jdbc/src/main/java/io/pivotal/cfenv/jdbc/DB2JdbcUrlCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public String buildJdbcUrlFromUriField(CfCredentials cfCredentials) {
4747
UriInfo uriInfo = cfCredentials.getUriInfo(DB2_SCHEME);
4848
return String.format("jdbc:%s://%s:%d/%s:user=%s;password=%s;",
4949
DB2_SCHEME, uriInfo.getHost(), uriInfo.getPort(), uriInfo.getPath(),
50-
UriInfo.urlEncode(uriInfo.getUsername()), UriInfo.urlEncode(uriInfo.getPassword()));
50+
uriInfo.getUsername(), uriInfo.getPassword());
5151
}
5252

5353

java-cfenv-jdbc/src/test/java/io/pivotal/cfenv/jdbc/DB2JdbcTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,6 @@ protected String getExpectedJdbcUrl(String databaseType, String name) {
123123

124124
protected String getExpectedJdbcUrl(String scheme, String name, String uname, String pwd) {
125125
return String.format("jdbc:%s://%s:%d/%s:user=%s;password=%s;",
126-
DB2JdbcUrlCreator.DB2_SCHEME, hostname, port, name, UriInfo.urlEncode(uname), UriInfo.urlEncode(pwd));
126+
DB2JdbcUrlCreator.DB2_SCHEME, hostname, port, name, uname, pwd);
127127
}
128128
}

0 commit comments

Comments
 (0)