public static interface Connection.Builder
Connection
builder. A Connection
is initially in the
Connection.Lifecycle.NEW
lifecycle state. It transitions to the
Connection.Lifecycle.OPEN
lifecycle state when fully initialized or
to Connection.Lifecycle.CLOSED
if initialization fails.Modifier and Type | Method | Description |
---|---|---|
Connection |
build() |
Return a
Connection with the attributes specified. |
Connection.Builder |
executor(java.util.concurrent.Executor exec) |
Used to execute
Operation s created by this Connection . |
Connection.Builder |
property(ConnectionProperty p,
java.lang.Object v) |
Specify a property and its value for the built
Connection . |
Connection.Builder executor(java.util.concurrent.Executor exec)
Operation
s created by this Connection
.
The default is ....exec
- provide an Executor
for the Connection
to use
when executing. asynchronous work. Not null
.Connection.Builder
java.lang.IllegalStateException
- if this method has already been calledjava.lang.IllegalArgumentException
- if the argument is null
Connection.Builder property(ConnectionProperty p, java.lang.Object v)
Connection
.p
- ConnectionProperty
to set. Not null
.v
- value for the propertyConnection.Builder
java.lang.IllegalArgumentException
- if p.validate(v)
does not return
true or if this method has already been called with the property
p
.Connection build()
Connection
with the attributes specified. Note that the
Connection
may not be connected to a server. Call one of the
Connection.connect()
convenience methods to connect the Connection
to
a server. The lifecycle of the new Connection
is Connection.Lifecycle.NEW
.Connection
java.lang.IllegalStateException
- if this method has already been called.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