パッケージ org.postgresql.core
クラス ConnectionFactory
java.lang.Object
org.postgresql.core.ConnectionFactory
- 直系の既知のサブクラス:
ConnectionFactoryImpl
Handles protocol-specific connection setup.
-
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明protected void
closeStream
(@Nullable PGStream newStream) Safely close the given stream.static QueryExecutor
openConnection
(HostSpec[] hostSpecs, Properties info) Establishes and initializes a new connection.abstract QueryExecutor
openConnectionImpl
(HostSpec[] hostSpecs, Properties info) Implementation ofopenConnection(org.postgresql.util.HostSpec[], java.util.Properties)
for a particular protocol version.
-
コンストラクタの詳細
-
ConnectionFactory
public ConnectionFactory()
-
-
メソッドの詳細
-
openConnection
public static QueryExecutor openConnection(HostSpec[] hostSpecs, Properties info) throws SQLException Establishes and initializes a new connection.
If the "protocolVersion" property is specified, only that protocol version is tried. Otherwise, all protocols are tried in order, falling back to older protocols as necessary.
Currently, protocol versions 3 (7.4+) is supported.
- パラメータ:
hostSpecs
- at least one host and port to connect to; multiple elements for round-robin failoverinfo
- extra properties controlling the connection; notably, "password" if present supplies the password to authenticate with.- 戻り値:
- the new, initialized, connection
- 例外:
SQLException
- if the connection could not be established.
-
openConnectionImpl
public abstract QueryExecutor openConnectionImpl(HostSpec[] hostSpecs, Properties info) throws SQLException Implementation ofopenConnection(org.postgresql.util.HostSpec[], java.util.Properties)
for a particular protocol version. Implemented by subclasses ofConnectionFactory
.- パラメータ:
hostSpecs
- at least one host and port to connect to; multiple elements for round-robin failoverinfo
- extra properties controlling the connection; notably, "password" if present supplies the password to authenticate with.- 戻り値:
- the new, initialized, connection, or
null
if this protocol version is not supported by the server. - 例外:
SQLException
- if the connection could not be established for a reason other than protocol version incompatibility.
-
closeStream
Safely close the given stream.- パラメータ:
newStream
- The stream to close.
-