org.mariadb.jdbc

## Class JDBCUrl

- java.lang.Object
- - org.mariadb.jdbc.JDBCUrl

    public class JDBCUrl
    extends Object

parse and verification of URL.

basic syntax :
`jdbc:(mysql|mariadb):[replication:|loadbalance:|aurora:]//<hostDescription>[,<hostDescription>]/[database>][?<key1>=<value1>[&<key2>=<value2>]]`

hostDescription:
- simple :
`<host>:<portnumber>`
(for example localhost:3306)
- complex :
`address=[(type=(master|slave))][(port=<portnumber>)](host=<host>)`
type is by default master
port is by default 3306

host can be dns name, ipv4 or ipv6.
in case of ipv6 and simple host description, the ip must be written inside bracket.
exemple : `jdbc:mysql://[2001:0660:7401:0200:0000:0000:0edf:bdd7]:3306`

Some examples :
`jdbc:mysql://localhost:3306/database?user=greg&password=pass`
`jdbc:mysql://address=(type=master)(host=master1),address=(port=3307)(type=slave)(host=slave1)/database?user=greg&password=pass`

### Constructor Summary

Constructors
`protected` `JDBCUrl(String database, List<HostAddress> addresses, Options options, UrlHAMode haMode)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`String` `getDatabase()`
`UrlHAMode` `getHaMode()`
`List<HostAddress>` `getHostAddresses()`
`Options` `getOptions()`
`String` `getPassword()`
`String` `getUsername()`
`static JDBCUrl` `parse(String url)`
`static JDBCUrl` `parse(String url, Properties prop)`
`void` `parseUrl(String url)`
`protected void` `setDatabase(String database)`
`protected void` `setPassword(String password)`
`protected void` `setProperties(String urlParameters)`
`protected void` `setUsername(String username)`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### JDBCUrl

    protected JDBCUrl(String database,
                      List<HostAddress> addresses,
                      Options options,
                      UrlHAMode haMode)
               throws SQLException

Throws:
  `SQLException`

### Method Detail

#### parse

    public static JDBCUrl parse(String url)
                         throws SQLException

Throws:
  `SQLException`

#### parse

    public static JDBCUrl parse(String url,
                                Properties prop)
                         throws SQLException

Throws:
  `SQLException`

#### parseUrl

    public void parseUrl(String url)
                  throws SQLException

Throws:
  `SQLException`

#### getUsername

    public String getUsername()

#### getPassword

    public String getPassword()

#### getDatabase

    public String getDatabase()

#### getHostAddresses

    public List<HostAddress> getHostAddresses()

#### setUsername

    protected void setUsername(String username)

#### setPassword

    protected void setPassword(String password)

#### getOptions

    public Options getOptions()

#### setDatabase

    protected void setDatabase(String database)

#### setProperties

    protected void setProperties(String urlParameters)

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### getHaMode

    public UrlHAMode getHaMode()