Package org.firebirdsql.gds.ng
Class AbstractConnection<T extends IAttachProperties<T>,C extends FbAttachment>
java.lang.Object
org.firebirdsql.gds.ng.AbstractConnection<T,C>
- Type Parameters:
T- Type of attach propertiesC- Type of connection handle
- Direct Known Subclasses:
JnaConnection,WireConnection
public abstract class AbstractConnection<T extends IAttachProperties<T>,C extends FbAttachment>
extends Object
Abstract class with common logic for connections.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConnection(T attachProperties, IEncodingFactory encodingFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal DbCryptCallbackCreates an instance ofDbCryptCallbackfor this connection.final Stringfinal Tfinal Encodingfinal EncodingDefinitionfinal IEncodingFactoryfinal intfinal Stringabstract Cidentify()Performs the connection identification phase of the protocol and returns the connection handle implementation for the agreed protocol.
-
Field Details
-
attachProperties
-
-
Constructor Details
-
AbstractConnection
protected AbstractConnection(T attachProperties, IEncodingFactory encodingFactory) throws SQLException - Throws:
SQLException
-
-
Method Details
-
identify
Performs the connection identification phase of the protocol and returns the connection handle implementation for the agreed protocol.- Returns:
- Connection handle (ie
FbDatabaseorFbService) - Throws:
SQLException- For exceptions connecting
-
getServerName
-
getPortNumber
public final int getPortNumber() -
getAttachObjectName
-
getAttachProperties
- Returns:
- An immutable copy of the current attach properties.
-
getEncodingDefinition
-
getEncoding
-
getEncodingFactory
-
createDbCryptCallback
Creates an instance ofDbCryptCallbackfor this connection.- Returns:
- Database encryption callback.
- Throws:
SQLException- For errors initializing the callback
-