Class MySQLConnectOptions

    • Constructor Detail

      • MySQLConnectOptions

        public MySQLConnectOptions()
      • MySQLConnectOptions

        public MySQLConnectOptions​(JsonObject json)
    • Method Detail

      • getCollation

        public String getCollation()
        Get the collation for the connection.
        Returns:
        the MySQL collation
      • setCollation

        public MySQLConnectOptions setCollation​(String collation)
        Set the collation for the connection.
        Parameters:
        collation - the collation to set
        Returns:
        a reference to this, so the API can be used fluently
      • getCharset

        public String getCharset()
        Get the charset for the connection.
        Returns:
        the MySQL collation
      • setCharset

        public MySQLConnectOptions setCharset​(String charset)
        Set the charset for the connection.
        Parameters:
        charset - the charset to set
        Returns:
        a reference to this, so the API can be used fluently
      • getCharacterEncoding

        public String getCharacterEncoding()
        Get the Java charset for encoding string values.
        Returns:
        the charset name
      • setCharacterEncoding

        public MySQLConnectOptions setCharacterEncoding​(String characterEncoding)
        Set the Java charset for encoding string values, this value is UTF-8 by default.
        Parameters:
        characterEncoding - the Java charset to configure
        Returns:
        a reference to this, so the API can be used fluently
      • isUseAffectedRows

        public boolean isUseAffectedRows()
        Get how affected rows are calculated on update/delete/insert.
        Returns:
        how affected rows are calculated on update/delete/insert.
      • setUseAffectedRows

        public MySQLConnectOptions setUseAffectedRows​(boolean useAffectedRows)
        Sets how affected rows are calculated on update/delete/insert, if set to true an update that effectively does not change any data returns zero affected rows. See mysql-affected-rows for details.
        Parameters:
        useAffectedRows - whether only affected rows are count
        Returns:
        a reference to this, so the API can be used fluently
      • getSslMode

        public SslMode getSslMode()
        Get the value of the configured SSL mode.
        Returns:
        the sslmode
      • setSslMode

        public MySQLConnectOptions setSslMode​(SslMode sslMode)
        Set the SslMode for the client, this option can be used to specify the desired security state of the connection to the server.
        Parameters:
        sslMode - the ssl-mode to specify
        Returns:
        a reference to this, so the API can be used fluently
      • getAuthenticationPlugin

        public MySQLAuthenticationPlugin getAuthenticationPlugin()
        Get the default authentication plugin for connecting the server.
        Returns:
        the authentication plugin
      • setAuthenticationPlugin

        public MySQLConnectOptions setAuthenticationPlugin​(MySQLAuthenticationPlugin authenticationPlugin)
        Set the default authentication plguin for the client, the option will take effect at the connection start.
        Parameters:
        authenticationPlugin - the auth plugin to use
        Returns:
        a reference to this, so the API can be used fluently
      • setServerRsaPublicKeyPath

        public MySQLConnectOptions setServerRsaPublicKeyPath​(String serverRsaPublicKeyPath)
        Set the path of server RSA public key which is mostly used for encrypting password under insecure connections when performing authentication.
        Parameters:
        serverRsaPublicKeyPath - the path of the server RSA public key
        Returns:
        a reference to this, so the API can be used fluently
      • getServerRsaPublicKeyPath

        public String getServerRsaPublicKeyPath()
        Get the path of the server RSA public key.
        Returns:
        the public key path
      • setServerRsaPublicKeyValue

        public MySQLConnectOptions setServerRsaPublicKeyValue​(Buffer serverRsaPublicKeyValue)
        Set the value of server RSA public key which is mostly used for encrypting password under insecure connections when performing authentication.
        Parameters:
        serverRsaPublicKeyValue - the value of the server RSA public key
        Returns:
        a reference to this, so the API can be used fluently
      • getServerRsaPublicKeyValue

        public Buffer getServerRsaPublicKeyValue()
        Get the value of the server RSA public key.
        Returns:
        the public key value
      • getPipeliningLimit

        public int getPipeliningLimit()
        Get the pipelining limit count.
        Returns:
        the pipelining count
      • setPipeliningLimit

        public MySQLConnectOptions setPipeliningLimit​(int pipeliningLimit)
        Set the pipelining limit count.
        Parameters:
        pipeliningLimit - the count to configure
        Returns:
        a reference to this, so the API can be used fluently
      • setPort

        public MySQLConnectOptions setPort​(int port)
        Description copied from class: SqlConnectOptions
        Specify the port for connecting to the server.
        Overrides:
        setPort in class SqlConnectOptions
        Parameters:
        port - the port to specify
        Returns:
        a reference to this, so the API can be used fluently
      • setCachePreparedStatements

        public MySQLConnectOptions setCachePreparedStatements​(boolean cachePreparedStatements)
        Description copied from class: SqlConnectOptions
        Set whether prepared statements cache should be enabled.
        Overrides:
        setCachePreparedStatements in class SqlConnectOptions
        Parameters:
        cachePreparedStatements - true if cache should be enabled
        Returns:
        a reference to this, so the API can be used fluently
      • setPreparedStatementCacheMaxSize

        public MySQLConnectOptions setPreparedStatementCacheMaxSize​(int preparedStatementCacheMaxSize)
        Description copied from class: SqlConnectOptions
        Set the maximum number of prepared statements that the connection will cache.
        Overrides:
        setPreparedStatementCacheMaxSize in class SqlConnectOptions
        Parameters:
        preparedStatementCacheMaxSize - the size to set
        Returns:
        a reference to this, so the API can be used fluently
      • setProperties

        public MySQLConnectOptions setProperties​(Map<String,​String> properties)
        Description copied from class: SqlConnectOptions
        Set properties for this client, which will be sent to server at the connection start.
        Overrides:
        setProperties in class SqlConnectOptions
        Parameters:
        properties - the value of properties to specify
        Returns:
        a reference to this, so the API can be used fluently
      • addProperty

        public MySQLConnectOptions addProperty​(String key,
                                               String value)
        Description copied from class: SqlConnectOptions
        Add a property for this client, which will be sent to server at the connection start.
        Overrides:
        addProperty in class SqlConnectOptions
        Parameters:
        key - the value of property key
        value - the value of property value
        Returns:
        a reference to this, so the API can be used fluently
      • init

        protected void init()
        Initialize with the default options.
        Overrides:
        init in class SqlConnectOptions
      • merge

        public MySQLConnectOptions merge​(JsonObject other)
        Description copied from class: SqlConnectOptions
        Returns new options created after this object and merged with the other json config.
        Overrides:
        merge in class SqlConnectOptions
        Parameters:
        other - the other JSON object
        Returns:
        new options created after this object and merged with the other json config