public class MySqlUrlParser extends Object
| Constructor and Description |
|---|
MySqlUrlParser() |
| Modifier and Type | Method and Description |
|---|---|
String |
getUrl(String hostname,
String port,
String instance)
Returns the JDBC URL for this DB config.
|
DatabaseInstance |
parseUrl(String jdbcUrl)
Parses JDBC URL for MySql
Supports Standard and Alternate URL formats
Standard format:
jdbc:mysql://[host1][:port1][,[host2][:port2]]...[/[database]][?propertyName1=propertyValue1[&propertyName2=propertyValue2]...]
Alternate format:
jdbc:mysql://address=(key1=value)[(key2=value)]...[,address=(key3=value)[(key4=value)]...]...[/[database]][?propertyName1=propertyValue1[&propertyName2=propertyValue2]...]
|
public String getUrl(String hostname, String port, String instance)
JdbcUrlParsergetUrl in interface JdbcUrlParserhostname - the hostnameport - the TCP/IP port numberinstance - the DB "instance"public DatabaseInstance parseUrl(String jdbcUrl) throws ParseException
parseUrl in interface JdbcUrlParserjdbcUrl - - JDBC URL in standard or alternate formatDatabaseInstance containing extracted hostname, port and instance name.ParseExceptionCopyright © 2002-2019 Atlassian. All Rights Reserved.