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)
JdbcUrlParser
getUrl
in interface JdbcUrlParser
hostname
- the hostnameport
- the TCP/IP port numberinstance
- the DB "instance"public DatabaseInstance parseUrl(String jdbcUrl) throws ParseException
parseUrl
in interface JdbcUrlParser
jdbcUrl
- - JDBC URL in standard or alternate formatDatabaseInstance
containing extracted hostname, port and instance name.ParseException
Copyright © 2002-2022 Atlassian. All Rights Reserved.