JdbcConnectionProperty
public interface ConnectionProperty
Connection
that can be configured to influence its
behavior. Implementors of this interface define the properties of
Connection
s. The Connection.Builder.property(java.sql2.ConnectionProperty, java.lang.Object)
method is used to set the values
of Connection
properties.Modifier and Type | Method | Description |
---|---|---|
default Operation |
configureOperation(OperationGroup group,
java.lang.Object value) |
Returns an
Operation that will configure the Connection to have the
specified property value. |
java.lang.Object |
defaultValue() |
Return the value for this property to use if no other value is set.
|
boolean |
isSensitive() |
Returns true if this
ConnectionProperty is contains sensitive information
such as a password or encryption key. |
java.lang.String |
name() |
Return the name of this
ConnectionProperty . |
java.lang.Class |
range() |
Return the type of the value of this
ConnectionProperty . |
default boolean |
validate(java.lang.Object value) |
Determine whether a value is valid for this
ConnectionProperty . |
java.lang.String name()
ConnectionProperty
.ConnectionProperty
java.lang.Class range()
ConnectionProperty
. Any value
set for this property must be assignable to this type.ConnectionProperty
default boolean validate(java.lang.Object value)
ConnectionProperty
. Returns
true
if value
is valid and false
otherwise.value
- a value for this ConnectionProperty
true
iff value
is valid for this ConnectionProperty
java.lang.Object defaultValue()
DataSource
by calling
DataSource.Builder.registerConnectionProperty(java.sql2.ConnectionProperty)
.null
if there is no default valueboolean isSensitive()
ConnectionProperty
is contains sensitive information
such as a password or encryption key.default Operation configureOperation(OperationGroup group, java.lang.Object value)
Operation
that will configure the Connection
to have the
specified property value. May return null
if no Operation
needed. The
returned Operation
is a member of group but is not submitted.
Called by Connection.Builder.build()
to configure a Connection
as specified
in the Connection.Builder.property(java.sql2.ConnectionProperty, java.lang.Object)
method. ConnectionProperties known to the implementation
may return null
and rely on the implementation to do the right thing.group
- an OperationGroup
which will be the container of the returned
Operation
, if anyvalue
- the value to which the property is to be set. May be null if
range()
is Void
.Operation
or nulljava.lang.IllegalStateException
- if it is not possible to configure the
Connection
as specified.java.lang.IllegalArgumentException
- if this.validate(value)
returns false
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
DRAFT JDBC 4.4 EA