Skip navigation links
Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12.2.1.2.0

Part Number E78001_01
oracle.ucp.jdbc

Interface LabelableConnection

    • Method Detail

      • applyConnectionLabel

        void applyConnectionLabel(String key,
                                  String value)
                           throws SQLException
        Applies connection labels on a borrowed connection while the connection is open. Applying connection labels is cumulative; the supplied key/value pair is added to those connection labels already applied each time this method is called. However, for each particular label key, only the last applied value is retained. Applying connection labels on a closed connection throws a UniversalConnectionPoolException.
        Parameters:
        key - The key of the connection label to be applied. Cannot be null or an empty string.
        value - The value of the connection label to be applied. Can be null or an empty string.
        Throws:
        SQLException - If this connection was closed or the key is null or an empty string.
      • removeConnectionLabel

        void removeConnectionLabel(String key)
                            throws SQLException
        Removes the connection label with the given key from the connection labels applied on this connection. This method does nothing if there is no applied label with the specified key.
        Parameters:
        key - The key of the connection label to be removed. Cannot be null or an empty string.
        Throws:
        SQLException - If this connection was closed or the key is null or an empty string.
      • getConnectionLabels

        Properties getConnectionLabels()
                                throws SQLException
        Retrieves all the connection labels applied on this connection. Any change to the result Properties object does not affect the labels applied to this connection.
        Returns:
        A java.util.Properties object storing all the applied labels as key/value pairs. Returns null if there are no applied labels on this connection.
        Throws:
        SQLException - If this connection was closed.
      • getUnmatchedConnectionLabels

        Properties getUnmatchedConnectionLabels(Properties requestedLabels)
                                         throws SQLException
        Obtains all the requested labels that did not match the applied labels on this connection when this connection was borrowed from the pool.

        This method is typically used to verify which labels in the requested labels are matched and which labels are not.

        Parameters:
        requestedLabels - The requested labels that borrowed this connection from the pool.
        Returns:
        A java.util.Properties object storing all the requested labels that did not match the labels applied on this connection. Returns null if there are none.
        Throws:
        SQLException - If this connection was closed.
Copyright 1996, 2016, Oracle and/or its affiliates. All rights reserved.