NonRegisteringReplicationDriver
Date: 2018-05-06

com.mysql.jdbc

## Class NonRegisteringReplicationDriver

- java.lang.Object
- - com.mysql.jdbc.NonRegisteringDriver
  - - com.mysql.jdbc.NonRegisteringReplicationDriver

- All Implemented Interfaces:
    java.sql.Driver
  Direct Known Subclasses:
    ReplicationDriver

      public class NonRegisteringReplicationDriver
      extends NonRegisteringDriver

  Driver that opens two connections, one two a replication master, and another to one or more slaves, and decides to use master when the connection is not read-only, and use slave(s) when the connection is read-only.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.mysql.jdbc.NonRegisteringDriver

      `NonRegisteringDriver.ConnectionPhantomReference`

  - ### Field Summary

    - ### Fields inherited from class com.mysql.jdbc.NonRegisteringDriver

      `connectionPhantomRefs, DBNAME_PROPERTY_KEY, DEBUG, HOST_NAME_INDEX, HOST_PROPERTY_KEY, LICENSE, LOADBALANCE_URL_PREFIX, NAME, NUM_HOSTS_PROPERTY_KEY, OS, PASSWORD_PROPERTY_KEY, PATH_PROPERTY_KEY, PLATFORM, PORT_NUMBER_INDEX, PORT_PROPERTY_KEY, PROPERTIES_TRANSFORM_KEY, PROTOCOL_PROPERTY_KEY, refQueue, RUNTIME_VENDOR, RUNTIME_VERSION, TRACE, USE_CONFIG_PROPERTY_KEY, USER_PROPERTY_KEY, VERSION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NonRegisteringReplicationDriver()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.sql.Connection` | `connect(java.lang.String url, java.util.Properties info)` Try to make a database connection to the given URL.

    - ### Methods inherited from class com.mysql.jdbc.NonRegisteringDriver

      `acceptsURL, connectReplicationConnection, database, expandHostKeyValues, getMajorVersion, getMajorVersionInternal, getMinorVersion, getMinorVersionInternal, getOSName, getPlatform, getPropertyInfo, host, isHostPropertiesList, jdbcCompliant, parseHostPortPair, parseURL, port, property, trackConnection`

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

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

    - ### Methods inherited from interface java.sql.Driver

      `getParentLogger`

- - ### Constructor Detail

    - #### NonRegisteringReplicationDriver

          public NonRegisteringReplicationDriver()
                                          throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

  - ### Method Detail

    - #### connect

          public java.sql.Connection connect(java.lang.String url,
                                    java.util.Properties info)
                                      throws java.sql.SQLException

      Description copied from class: `NonRegisteringDriver`
      Try to make a database connection to the given URL. The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. This will be common, as when the JDBC driverManager is asked to connect to a given URL, it passes the URL to each loaded driver in turn.

      The driver should raise an SQLException if the URL is null or if it is the right driver to connect to the given URL, but has trouble connecting to the database.

      The java.util.Properties argument can be used to pass arbitrary string tag/value pairs as connection arguments. These properties take precedence over any properties sent in the URL.

      MySQL protocol takes the form:

           jdbc:mysql://host:port/database

      Specified by:
        `connect` in interface `java.sql.Driver`
      Overrides:
        `connect` in class `NonRegisteringDriver`
      Parameters:
        `url` - the URL of the database to connect to
        `info` - a list of arbitrary tag/value pairs as connection arguments
      Returns:
        a connection to the URL or null if it isn't us
      Throws:
        `java.sql.SQLException` - if a database access error occurs or the url is null
      See Also:
        `Driver.connect(java.lang.String, java.util.Properties)`