MySQL JDBC Format
[resolves #8] Signed-off-by: Ben Hale <bhale@vmware.com>
This commit is contained in:
@@ -25,6 +25,8 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* An implementation of {@link BindingsPropertiesProcessor} that detects {@link Binding}s of kind: {@value KIND}.
|
||||
*
|
||||
* @see <a href="https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-jdbc-url-format.html">JDBC URL Format</a>
|
||||
*/
|
||||
public final class MySqlBindingsPropertiesProcessor implements BindingsPropertiesProcessor {
|
||||
|
||||
@@ -50,9 +52,8 @@ public final class MySqlBindingsPropertiesProcessor implements BindingsPropertie
|
||||
}
|
||||
|
||||
properties.put("spring.datasource.password", secret.get("password"));
|
||||
properties.put("spring.datasource.url", String.format("jdbc:mysql://%s:%s/%s?user=%s&password=%s",
|
||||
secret.get("host"), secret.get("port"), secret.get("db"), secret.get("username"),
|
||||
secret.get("password")));
|
||||
properties.put("spring.datasource.url", String.format("jdbc:mysql://%s:%s/%s",
|
||||
secret.get("host"), secret.get("port"), secret.get("database")));
|
||||
properties.put("spring.datasource.username", secret.get("username"));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user