|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.1.3) Part Number E41849-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LabelableConnection
Interface supporting Connection Labeling for JDBC
java.sql.Connections
.
getConnection(...) methods (with labels parameter) and the
labeling callbacks for complete connection labeling functions.
- See Also:
PoolDataSource
,
ConnectionLabelingCallback
Method Summary
void
applyConnectionLabel(String key,
String value)
Applies connection labels on a borrowed connection while the
connection is open.
Properties
getConnectionLabels()
Retrieves all the connection labels applied on this connection.
Properties
getUnmatchedConnectionLabels(Properties requestedLabels)
Obtains all the requested labels that did not match the applied
labels on this connection when this connection was borrowed from
the pool.
void
removeConnectionLabel(String key)
Removes the connection label with the given key from the connection
labels applied on this connection.
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.
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Copyright 1996, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.3)
Part Number E41849-02
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD