Class FBManagedConnectionFactory
- java.lang.Object
-
- org.firebirdsql.jca.FBManagedConnectionFactory
-
- All Implemented Interfaces:
java.io.Serializable
,javax.resource.spi.ManagedConnectionFactory
,FirebirdConnectionProperties
public class FBManagedConnectionFactory extends java.lang.Object implements javax.resource.spi.ManagedConnectionFactory, FirebirdConnectionProperties, java.io.Serializable
FBManagedConnectionFactory implements the jca ManagedConnectionFactory interface and also many of the internal functions of ManagedConnection. This nonstandard behavior is required due to firebird requiring all work done in a transaction to be done over one connection. To support xa semantics, the correct db handle must be located whenever a ManagedConnection is associated with an xid. WARNING: this adapter will probably not work properly in an environment where ManagedConnectionFactory is serialized and deserialized, and the deserialized copy is expected to function as anything other than a key.- Author:
- David Jencks , Mark Rotteveel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FBManagedConnectionFactory()
Create a new pure-Java FBManagedConnectionFactory.FBManagedConnectionFactory(GDSType gdsType)
Create a new FBManagedConnectionFactory based around the given GDSType.FBManagedConnectionFactory(GDSType gdsType, FBConnectionProperties connectionProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FBManagedConnectionFactory
canonicalize()
Thecanonicalize
method is used in FBDriver to reuse previous fbmcf instances if they have been create.java.lang.Object
createConnectionFactory()
ThecreateConnectionFactory
method creates a DataSource with a default stand alone ConnectionManager.java.lang.Object
createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
ThecreateConnectionFactory
method creates a DataSource using the supplied ConnectionManager.javax.resource.spi.ManagedConnection
createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri)
Creates a new physical connection to the underlying EIS resource manager, ManagedConnectionFactory uses the security information (passed as Subject) and additional ConnectionRequestInfo (which is specific to ResourceAdapter and opaque to application server) to create this new connection.boolean
equals(java.lang.Object other)
void
forget(FBManagedConnection mc, javax.transaction.xa.Xid xid)
java.lang.String
getAuthPlugins()
Get the list of authentication plugins to try.int
getBlobBufferLength()
Deprecated.int
getBlobBufferSize()
int
getBuffersNumber()
FBConnectionProperties
getCacheKey()
java.lang.String
getCharSet()
int
getConnectTimeout()
Get the current connect timeout.java.lang.String
getDatabase()
FbDatabaseFactory
getDatabaseFactory()
DatabaseParameterBuffer
getDatabaseParameterBuffer()
Get the database parameter buffer corresponding to the current connection request information.java.lang.String
getDataTypeBind()
Get thedataTypeBind
configuration.java.lang.String
getDbCryptConfig()
Get the database encryption plugin configuration.FBConnectionRequestInfo
getDefaultConnectionRequestInfo()
java.lang.String
getDefaultIsolation()
Get the default transaction isolation level as string.FBTpb
getDefaultTpb()
int
getDefaultTransactionIsolation()
Get the default transaction isolation level.java.lang.String
getEncoding()
GDSType
getGDSType()
Get the GDS implementation type around which this factory is based.java.lang.String
getGeneratedKeysEnabled()
Get thegeneratedKeysEnabled
configuration.java.lang.String
getLocalEncoding()
Deprecated.usegetCharSet()
instead.java.io.PrintWriter
getLogWriter()
Get the log writer for thisManagedConnectionFactory
instance.java.lang.String
getNonStandardProperty(java.lang.String key)
Get the property that does not have corresponding getter method by its name.java.lang.String
getPassword()
java.lang.String
getRoleName()
java.lang.String
getSessionTimeZone()
Get thesessionTimeZone
.int
getSocketBufferSize()
int
getSoTimeout()
Get the current Socket blocking timeout (SoTimeout).java.lang.String
getSqlDialect()
FBTpb
getTpb(int defaultTransactionIsolation)
java.lang.String
getTpbMapping()
Get the used TPB mapping.java.lang.Integer
getTransactionIsolation()
Deprecated.java.lang.String
getTransactionIsolationName()
Deprecated.TransactionParameterBuffer
getTransactionParameters(int isolation)
Get the transaction parameter buffer corresponding to the current connection request information.java.lang.String
getType()
java.lang.String
getUserName()
java.lang.String
getWireCrypt()
Get the wire encryption level value.int
hashCode()
boolean
isDefaultResultSetHoldable()
Get the default ResultSet holdability.boolean
isIgnoreProcedureType()
Get the value forignoreProcedureType
.boolean
isTimestampUsesLocalTimezone()
boolean
isUseFirebirdAutocommit()
Get whether to use Firebird autocommit (experimental).boolean
isUseStandardUdf()
boolean
isUseStreamBlobs()
boolean
isWireCompression()
Get if wire compression should be enabled.javax.resource.spi.ManagedConnection
matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
Returns a matched connection from the candidate set of connections.void
recover(FBManagedConnection mc, javax.transaction.xa.Xid xid)
void
setAuthPlugins(java.lang.String authPlugins)
Sets the authentication plugins to try.void
setBlobBufferLength(int value)
Deprecated.void
setBlobBufferSize(int bufferSize)
void
setBuffersNumber(int buffersNumber)
void
setCharSet(java.lang.String charSet)
void
setConnectTimeout(int connectTimeout)
Set the connect timeout.void
setDatabase(java.lang.String database)
void
setDataTypeBind(java.lang.String dataTypeBind)
Sets thedataTypeBind
configuration.void
setDbCryptConfig(java.lang.String dbCryptConfig)
Sets the database encryption plugin configuration.void
setDefaultConnectionManager(javax.resource.spi.ConnectionManager defaultCm)
void
setDefaultIsolation(java.lang.String isolation)
Set the default transaction isolation level as string.void
setDefaultResultSetHoldable(boolean isHoldable)
Sets the default ResultSet holdability.void
setDefaultTransactionIsolation(int defaultIsolationLevel)
Set the default transaction isolation level.void
setEncoding(java.lang.String encoding)
void
setGeneratedKeysEnabled(java.lang.String generatedKeysEnabled)
Sets thegeneratedKeysEnabled
configuration.void
setIgnoreProcedureType(boolean ignoreProcedureType)
Sets the valueignoreProcedureType
.void
setLocalEncoding(java.lang.String localEncoding)
Deprecated.usesetCharSet(String)
instead.void
setLogWriter(java.io.PrintWriter out)
Set the log writer for thisManagedConnectionFactory
instance.void
setNonStandardProperty(java.lang.String propertyMapping)
Set the property that does not have corresponding setter method.void
setNonStandardProperty(java.lang.String key, java.lang.String value)
Set the property that does not have corresponding setter method.void
setPassword(java.lang.String password)
void
setRoleName(java.lang.String roleName)
void
setSessionTimeZone(java.lang.String sessionTimeZone)
Sets thesessionTimeZone
.void
setSocketBufferSize(int socketBufferSize)
void
setSoTimeout(int soTimeout)
Set the Socket blocking timeout (SoTimeout).void
setSqlDialect(java.lang.String sqlDialect)
void
setTimestampUsesLocalTimezone(boolean timestampUsesLocalTimezone)
void
setTpbMapping(java.lang.String tpbMapping)
Set path to the properties file with the TPB mapping.void
setTransactionIsolation(java.lang.Integer value)
Deprecated.void
setTransactionIsolationName(java.lang.String name)
Deprecated.void
setTransactionParameters(int isolation, TransactionParameterBuffer tpb)
Set transaction parameters for the specified transaction isolation level.void
setType(java.lang.String type)
void
setUseFirebirdAutocommit(boolean useFirebirdAutocommit)
Set whether to use Firebird autocommit (experimental).void
setUserName(java.lang.String userName)
void
setUseStandardUdf(boolean useStandardUdf)
void
setUseStreamBlobs(boolean useStreamBlobs)
void
setWireCompression(boolean wireCompression)
Sets if the connection should try to enable wire compression.void
setWireCrypt(java.lang.String wireCrypt)
Sets the wire encryption level.
-
-
-
Constructor Detail
-
FBManagedConnectionFactory
public FBManagedConnectionFactory()
Create a new pure-Java FBManagedConnectionFactory.
-
FBManagedConnectionFactory
public FBManagedConnectionFactory(GDSType gdsType)
Create a new FBManagedConnectionFactory based around the given GDSType.- Parameters:
gdsType
- The GDS implementation to use
-
FBManagedConnectionFactory
public FBManagedConnectionFactory(GDSType gdsType, FBConnectionProperties connectionProperties)
-
-
Method Detail
-
getDatabaseFactory
public FbDatabaseFactory getDatabaseFactory()
-
getGDSType
public GDSType getGDSType()
Get the GDS implementation type around which this factory is based.- Returns:
- The GDS implementation type
-
getBlobBufferLength
@Deprecated public int getBlobBufferLength()
Deprecated.
-
setBlobBufferLength
@Deprecated public void setBlobBufferLength(int value)
Deprecated.
-
getTransactionIsolation
@Deprecated public java.lang.Integer getTransactionIsolation()
Deprecated.
-
setTransactionIsolation
@Deprecated public void setTransactionIsolation(java.lang.Integer value)
Deprecated.
-
getTransactionIsolationName
@Deprecated public java.lang.String getTransactionIsolationName()
Deprecated.
-
setTransactionIsolationName
@Deprecated public void setTransactionIsolationName(java.lang.String name)
Deprecated.
-
getLocalEncoding
@Deprecated public java.lang.String getLocalEncoding()
Deprecated.usegetCharSet()
instead.
-
setLocalEncoding
@Deprecated public void setLocalEncoding(java.lang.String localEncoding)
Deprecated.usesetCharSet(String)
instead.
-
getBlobBufferSize
public int getBlobBufferSize()
- Specified by:
getBlobBufferSize
in interfaceFirebirdConnectionProperties
- Returns:
- BLOB buffer size in bytes.
-
getBuffersNumber
public int getBuffersNumber()
- Specified by:
getBuffersNumber
in interfaceFirebirdConnectionProperties
- Returns:
- number of cache buffers that should be allocated for this connection, should be specified for ClassicServer instances, SuperServer has a server-wide configuration parameter.
-
getCharSet
public java.lang.String getCharSet()
- Specified by:
getCharSet
in interfaceFirebirdConnectionProperties
- Returns:
- Character set for the connection.
- See Also:
FirebirdConnectionProperties.setCharSet(String)
-
getDatabase
public java.lang.String getDatabase()
- Specified by:
getDatabase
in interfaceFirebirdConnectionProperties
- Returns:
- path to the database including the server name and the port, if needed.
-
getDatabaseParameterBuffer
public DatabaseParameterBuffer getDatabaseParameterBuffer() throws java.sql.SQLException
Description copied from interface:FirebirdConnectionProperties
Get the database parameter buffer corresponding to the current connection request information.- Specified by:
getDatabaseParameterBuffer
in interfaceFirebirdConnectionProperties
- Returns:
- instance of
DatabaseParameterBuffer
. - Throws:
java.sql.SQLException
- if database parameter buffer cannot be created.
-
getDefaultIsolation
public java.lang.String getDefaultIsolation()
Description copied from interface:FirebirdConnectionProperties
Get the default transaction isolation level as string. This method is complementary to theFirebirdConnectionProperties.getDefaultTransactionIsolation()
, however it takes a string as parameter instead of a numeric constant.- Specified by:
getDefaultIsolation
in interfaceFirebirdConnectionProperties
- Returns:
- default transaction isolation as string.
- See Also:
FirebirdConnectionProperties.setDefaultIsolation(String)
-
getDefaultTransactionIsolation
public int getDefaultTransactionIsolation()
Description copied from interface:FirebirdConnectionProperties
Get the default transaction isolation level. This is the transaction isolation level for the newly created connections.- Specified by:
getDefaultTransactionIsolation
in interfaceFirebirdConnectionProperties
- Returns:
- default transaction isolation level.
-
getEncoding
public java.lang.String getEncoding()
- Specified by:
getEncoding
in interfaceFirebirdConnectionProperties
- Returns:
- Character encoding for the connection.
- See Also:
FirebirdConnectionProperties.setEncoding(String)
-
getNonStandardProperty
public java.lang.String getNonStandardProperty(java.lang.String key)
Description copied from interface:FirebirdConnectionProperties
Get the property that does not have corresponding getter method by its name.- Specified by:
getNonStandardProperty
in interfaceFirebirdConnectionProperties
- Parameters:
key
- name of the property to get.- Returns:
- value of the property.
-
getPassword
public java.lang.String getPassword()
- Specified by:
getPassword
in interfaceFirebirdConnectionProperties
- Returns:
- password corresponding to the specified user name.
-
getRoleName
public java.lang.String getRoleName()
- Specified by:
getRoleName
in interfaceFirebirdConnectionProperties
- Returns:
- SQL role to use.
-
getSocketBufferSize
public int getSocketBufferSize()
- Specified by:
getSocketBufferSize
in interfaceFirebirdConnectionProperties
- Returns:
- socket buffer size in bytes, or -1 is not specified.
-
getSqlDialect
public java.lang.String getSqlDialect()
- Specified by:
getSqlDialect
in interfaceFirebirdConnectionProperties
- Returns:
- SQL dialect of the client.
-
getTpbMapping
public java.lang.String getTpbMapping()
Description copied from interface:FirebirdConnectionProperties
Get the used TPB mapping.- Specified by:
getTpbMapping
in interfaceFirebirdConnectionProperties
- Returns:
- path to the TPB mapping.
- See Also:
FirebirdConnectionProperties.setTpbMapping(String)
-
getTransactionParameters
public TransactionParameterBuffer getTransactionParameters(int isolation)
Description copied from interface:FirebirdConnectionProperties
Get the transaction parameter buffer corresponding to the current connection request information.- Specified by:
getTransactionParameters
in interfaceFirebirdConnectionProperties
- Parameters:
isolation
- transaction isolation level for which TPB should be returned.- Returns:
- instance of
TransactionParameterBuffer
.
-
getType
public java.lang.String getType()
- Specified by:
getType
in interfaceFirebirdConnectionProperties
- Returns:
- type of the connection, for example, "PURE_JAVA", "LOCAL", "EMBEDDED", depends on the GDS implementations installed in the system.
-
getUserName
public java.lang.String getUserName()
- Specified by:
getUserName
in interfaceFirebirdConnectionProperties
- Returns:
- name of the user that will be used when connecting to the database.
-
isTimestampUsesLocalTimezone
public boolean isTimestampUsesLocalTimezone()
- Specified by:
isTimestampUsesLocalTimezone
in interfaceFirebirdConnectionProperties
- Returns:
true
if the Jaybird 1.0 handling of the calendar in corresponding setters. This is also compatible with MySQL calendar treatment.
-
isUseStandardUdf
public boolean isUseStandardUdf()
- Specified by:
isUseStandardUdf
in interfaceFirebirdConnectionProperties
- Returns:
true
if driver should assume that standard UDF are installed.
-
isUseStreamBlobs
public boolean isUseStreamBlobs()
- Specified by:
isUseStreamBlobs
in interfaceFirebirdConnectionProperties
- Returns:
true
if stream blobs should be created, otherwisefalse
.
-
setBlobBufferSize
public void setBlobBufferSize(int bufferSize)
- Specified by:
setBlobBufferSize
in interfaceFirebirdConnectionProperties
- Parameters:
bufferSize
- size of the BLOB buffer in bytes.
-
setBuffersNumber
public void setBuffersNumber(int buffersNumber)
- Specified by:
setBuffersNumber
in interfaceFirebirdConnectionProperties
- Parameters:
buffersNumber
- number of cache buffers that should be allocated for this connection, should be specified for ClassicServer instances, SuperServer has a server-wide configuration parameter.
-
setCharSet
public void setCharSet(java.lang.String charSet)
- Specified by:
setCharSet
in interfaceFirebirdConnectionProperties
- Parameters:
charSet
- Character set for the connection. Similar toencoding
property, but accepts Java names instead of Firebird ones.
-
setDatabase
public void setDatabase(java.lang.String database)
- Specified by:
setDatabase
in interfaceFirebirdConnectionProperties
- Parameters:
database
- path to the database including the server name and the port, if needed.
-
setDefaultIsolation
public void setDefaultIsolation(java.lang.String isolation)
Description copied from interface:FirebirdConnectionProperties
Set the default transaction isolation level as string. This method is complementary to theFirebirdConnectionProperties.setDefaultTransactionIsolation(int)
, however it takes a string as parameter instead of a numeric constant. Following strings are allowed:"TRANSACTION_READ_COMMITTED"
for a READ COMMITTED isolation level."TRANSACTION_REPEATABLE_READ"
for a REPEATABLE READ isolation level."TRANSACTION_SERIALIZABLE"
for a SERIALIZABLE isolation level.
- Specified by:
setDefaultIsolation
in interfaceFirebirdConnectionProperties
- Parameters:
isolation
- string constant representing a default isolation level.
-
setDefaultTransactionIsolation
public void setDefaultTransactionIsolation(int defaultIsolationLevel)
Description copied from interface:FirebirdConnectionProperties
Set the default transaction isolation level.- Specified by:
setDefaultTransactionIsolation
in interfaceFirebirdConnectionProperties
- Parameters:
defaultIsolationLevel
- default transaction isolation level.
-
setEncoding
public void setEncoding(java.lang.String encoding)
- Specified by:
setEncoding
in interfaceFirebirdConnectionProperties
- Parameters:
encoding
- Character encoding for the connection. See Firebird documentation for more information.
-
setNonStandardProperty
public void setNonStandardProperty(java.lang.String key, java.lang.String value)
Description copied from interface:FirebirdConnectionProperties
Set the property that does not have corresponding setter method.- Specified by:
setNonStandardProperty
in interfaceFirebirdConnectionProperties
- Parameters:
key
- name of the property to set.value
- value of the property.
-
setNonStandardProperty
public void setNonStandardProperty(java.lang.String propertyMapping)
Description copied from interface:FirebirdConnectionProperties
Set the property that does not have corresponding setter method.- Specified by:
setNonStandardProperty
in interfaceFirebirdConnectionProperties
- Parameters:
propertyMapping
- parameter value in the ?propertyName[=propertyValue]? form, this allows setting non-standard parameters using configuration files.
-
setPassword
public void setPassword(java.lang.String password)
- Specified by:
setPassword
in interfaceFirebirdConnectionProperties
- Parameters:
password
- password corresponding to the specified user name.
-
setRoleName
public void setRoleName(java.lang.String roleName)
- Specified by:
setRoleName
in interfaceFirebirdConnectionProperties
- Parameters:
roleName
- SQL role to use.
-
setSocketBufferSize
public void setSocketBufferSize(int socketBufferSize)
- Specified by:
setSocketBufferSize
in interfaceFirebirdConnectionProperties
- Parameters:
socketBufferSize
- socket buffer size in bytes.
-
setSqlDialect
public void setSqlDialect(java.lang.String sqlDialect)
- Specified by:
setSqlDialect
in interfaceFirebirdConnectionProperties
- Parameters:
sqlDialect
- SQL dialect of the client.
-
setTimestampUsesLocalTimezone
public void setTimestampUsesLocalTimezone(boolean timestampUsesLocalTimezone)
- Specified by:
setTimestampUsesLocalTimezone
in interfaceFirebirdConnectionProperties
- Parameters:
timestampUsesLocalTimezone
-true
if the Jaybird 1.0 handling of the calendar in corresponding setters. This is also compatible with MySQL calendar treatment.
-
setTpbMapping
public void setTpbMapping(java.lang.String tpbMapping)
Description copied from interface:FirebirdConnectionProperties
Set path to the properties file with the TPB mapping. The path begins with the protocol specification followed by the path to the resource. A special protocol"res:"
should be used to specify resource in the classpath. For the compatibility reasons, if no protocol is specified, classpath is used by default. Properties file contains a mapping between the transaction isolation level (name of the constant in theConnection
interface and a comma-separated list of TPB parameters.- Specified by:
setTpbMapping
in interfaceFirebirdConnectionProperties
- Parameters:
tpbMapping
- path to the properties file.
-
setTransactionParameters
public void setTransactionParameters(int isolation, TransactionParameterBuffer tpb)
Description copied from interface:FirebirdConnectionProperties
Set transaction parameters for the specified transaction isolation level. The specified TPB is used as a default mapping for the specified isolation level.- Specified by:
setTransactionParameters
in interfaceFirebirdConnectionProperties
- Parameters:
isolation
- transaction isolation level.tpb
- instance ofTransactionParameterBuffer
containing transaction parameters.
-
setType
public void setType(java.lang.String type)
- Specified by:
setType
in interfaceFirebirdConnectionProperties
- Parameters:
type
- type of the connection, for example, "PURE_JAVA", "LOCAL", "EMBEDDED", depends on the GDS implementations installed in the system.
-
setUserName
public void setUserName(java.lang.String userName)
- Specified by:
setUserName
in interfaceFirebirdConnectionProperties
- Parameters:
userName
- name of the user that will be used when connecting to the database.
-
setUseStandardUdf
public void setUseStandardUdf(boolean useStandardUdf)
- Specified by:
setUseStandardUdf
in interfaceFirebirdConnectionProperties
- Parameters:
useStandardUdf
-true
if driver should assume that standard UDF are installed.
-
setUseStreamBlobs
public void setUseStreamBlobs(boolean useStreamBlobs)
- Specified by:
setUseStreamBlobs
in interfaceFirebirdConnectionProperties
- Parameters:
useStreamBlobs
-true
if stream blobs should be created, otherwisefalse
.
-
isDefaultResultSetHoldable
public boolean isDefaultResultSetHoldable()
Description copied from interface:FirebirdConnectionProperties
Get the default ResultSet holdability.- Specified by:
isDefaultResultSetHoldable
in interfaceFirebirdConnectionProperties
- Returns:
true
when ResultSets are holdable by default,false
not holdable.
-
setDefaultResultSetHoldable
public void setDefaultResultSetHoldable(boolean isHoldable)
Description copied from interface:FirebirdConnectionProperties
Sets the default ResultSet holdability.- Specified by:
setDefaultResultSetHoldable
in interfaceFirebirdConnectionProperties
- Parameters:
isHoldable
-true
when ResultSets are holdable by default,false
not holdable.
-
setDefaultConnectionManager
public void setDefaultConnectionManager(javax.resource.spi.ConnectionManager defaultCm)
-
getSoTimeout
public int getSoTimeout()
Description copied from interface:FirebirdConnectionProperties
Get the current Socket blocking timeout (SoTimeout).- Specified by:
getSoTimeout
in interfaceFirebirdConnectionProperties
- Returns:
- The socket blocking timeout in milliseconds (0 is 'infinite')
-
setSoTimeout
public void setSoTimeout(int soTimeout)
Description copied from interface:FirebirdConnectionProperties
Set the Socket blocking timeout (SoTimeout).- Specified by:
setSoTimeout
in interfaceFirebirdConnectionProperties
- Parameters:
soTimeout
- Timeout in milliseconds (0 is 'infinite')
-
getConnectTimeout
public int getConnectTimeout()
Description copied from interface:FirebirdConnectionProperties
Get the current connect timeout.- Specified by:
getConnectTimeout
in interfaceFirebirdConnectionProperties
- Returns:
- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
Description copied from interface:FirebirdConnectionProperties
Set the connect timeout.- Specified by:
setConnectTimeout
in interfaceFirebirdConnectionProperties
- Parameters:
connectTimeout
- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)
-
isUseFirebirdAutocommit
public boolean isUseFirebirdAutocommit()
Description copied from interface:FirebirdConnectionProperties
Get whether to use Firebird autocommit (experimental).- Specified by:
isUseFirebirdAutocommit
in interfaceFirebirdConnectionProperties
- Returns:
true
use Firebird autocommit
-
setUseFirebirdAutocommit
public void setUseFirebirdAutocommit(boolean useFirebirdAutocommit)
Description copied from interface:FirebirdConnectionProperties
Set whether to use Firebird autocommit (experimental).- Specified by:
setUseFirebirdAutocommit
in interfaceFirebirdConnectionProperties
- Parameters:
useFirebirdAutocommit
-true
Use Firebird autocommit
-
getWireCrypt
public java.lang.String getWireCrypt()
Description copied from interface:FirebirdConnectionProperties
Get the wire encryption level value.- Specified by:
getWireCrypt
in interfaceFirebirdConnectionProperties
- Returns:
- Wire encryption level (
null
impliesDEFAULT
)
-
setWireCrypt
public void setWireCrypt(java.lang.String wireCrypt)
Description copied from interface:FirebirdConnectionProperties
Sets the wire encryption level.Values are defined by
WireCrypt
, values are handled case insensitive. Invalid values are accepted, but will cause an error when a connection is established.- Specified by:
setWireCrypt
in interfaceFirebirdConnectionProperties
- Parameters:
wireCrypt
- Wire encryption level
-
getDbCryptConfig
public java.lang.String getDbCryptConfig()
Description copied from interface:FirebirdConnectionProperties
Get the database encryption plugin configuration.- Specified by:
getDbCryptConfig
in interfaceFirebirdConnectionProperties
- Returns:
- Database encryption plugin configuration, meaning plugin specific
-
setDbCryptConfig
public void setDbCryptConfig(java.lang.String dbCryptConfig)
Description copied from interface:FirebirdConnectionProperties
Sets the database encryption plugin configuration.- Specified by:
setDbCryptConfig
in interfaceFirebirdConnectionProperties
- Parameters:
dbCryptConfig
- Database encryption plugin configuration, meaning plugin specific
-
getAuthPlugins
public java.lang.String getAuthPlugins()
Description copied from interface:FirebirdConnectionProperties
Get the list of authentication plugins to try.- Specified by:
getAuthPlugins
in interfaceFirebirdConnectionProperties
- Returns:
- comma-separated list of authentication plugins, or
null
for driver default
-
setAuthPlugins
public void setAuthPlugins(java.lang.String authPlugins)
Description copied from interface:FirebirdConnectionProperties
Sets the authentication plugins to try.Invalid names are skipped during authentication.
- Specified by:
setAuthPlugins
in interfaceFirebirdConnectionProperties
- Parameters:
authPlugins
- comma-separated list of authentication plugins, ornull
for driver default
-
getGeneratedKeysEnabled
public java.lang.String getGeneratedKeysEnabled()
Description copied from interface:FirebirdConnectionProperties
Get thegeneratedKeysEnabled
configuration.- Specified by:
getGeneratedKeysEnabled
in interfaceFirebirdConnectionProperties
- Returns:
- configuration value for
generatedKeysEnabled
, ornull
for driver default
-
setGeneratedKeysEnabled
public void setGeneratedKeysEnabled(java.lang.String generatedKeysEnabled)
Description copied from interface:FirebirdConnectionProperties
Sets thegeneratedKeysEnabled
configuration.- Specified by:
setGeneratedKeysEnabled
in interfaceFirebirdConnectionProperties
- Parameters:
generatedKeysEnabled
- Generated keys support configuration:default
(or null/empty),disabled
,ignored
, or a list of statement types to enable (possible values:insert
,update
,delete
,update_or_insert
,merge
)
-
getDataTypeBind
public java.lang.String getDataTypeBind()
Description copied from interface:FirebirdConnectionProperties
Get thedataTypeBind
configuration.- Specified by:
getDataTypeBind
in interfaceFirebirdConnectionProperties
- Returns:
- configuration value for
dataTypeBind
, ornull
for driver default
-
setDataTypeBind
public void setDataTypeBind(java.lang.String dataTypeBind)
Description copied from interface:FirebirdConnectionProperties
Sets thedataTypeBind
configuration.If the value is explicitly set to a non-null value and the connected server is Firebird 4 or higher, this will configure the data type binding with the specified values using
isc_dpb_set_bind
, which is equivalent to executingSET BIND
statements with the values.See also Firebird documentation for
SET BIND
.- Specified by:
setDataTypeBind
in interfaceFirebirdConnectionProperties
- Parameters:
dataTypeBind
- Firebird 4+ data type bind configuration, a semicolon-separated list of<from-type> TO <to-type>
-
getSessionTimeZone
public java.lang.String getSessionTimeZone()
Description copied from interface:FirebirdConnectionProperties
Get thesessionTimeZone
.- Specified by:
getSessionTimeZone
in interfaceFirebirdConnectionProperties
- Returns:
- value for
sessionTimeZone
, ornull
for driver default (JVM default time zone)
-
setSessionTimeZone
public void setSessionTimeZone(java.lang.String sessionTimeZone)
Description copied from interface:FirebirdConnectionProperties
Sets thesessionTimeZone
.- Specified by:
setSessionTimeZone
in interfaceFirebirdConnectionProperties
- Parameters:
sessionTimeZone
- Firebird 4+ session time zone name (we strongly suggest to use Java compatible names only), use"server"
to use server default time zone (note: conversion will use JVM default time zone)
-
isIgnoreProcedureType
public boolean isIgnoreProcedureType()
Description copied from interface:FirebirdConnectionProperties
Get the value forignoreProcedureType
.- Specified by:
isIgnoreProcedureType
in interfaceFirebirdConnectionProperties
- Returns:
- value for
ignoreProcedureType
-
setIgnoreProcedureType
public void setIgnoreProcedureType(boolean ignoreProcedureType)
Description copied from interface:FirebirdConnectionProperties
Sets the valueignoreProcedureType
.When set to true, the
CallableStatement
implementation in Jaybird will ignore metadata information about the stored procedure type and default to usingEXECUTE PROCEDURE
, unless the type is explicitly set usingFirebirdCallableStatement.setSelectableProcedure(boolean)
. This can be useful in situations where a stored procedure is selectable, but tooling or code expects an executable stored procedure.- Specified by:
setIgnoreProcedureType
in interfaceFirebirdConnectionProperties
- Parameters:
ignoreProcedureType
-true
Ignore procedure type
-
isWireCompression
public boolean isWireCompression()
Description copied from interface:FirebirdConnectionProperties
Get if wire compression should be enabled.Wire compression requires Firebird 3 or higher, and the server must have the zlib library. If compression cannot be negotiated, the connection will be made without wire compression.
This property will be ignored for native connections. For native connections, the configuration in
firebird.conf
read by the client library will be used.- Specified by:
isWireCompression
in interfaceFirebirdConnectionProperties
- Returns:
true
wire compression enabled
-
setWireCompression
public void setWireCompression(boolean wireCompression)
Description copied from interface:FirebirdConnectionProperties
Sets if the connection should try to enable wire compression.- Specified by:
setWireCompression
in interfaceFirebirdConnectionProperties
- Parameters:
wireCompression
-true
enable wire compression,false
disable wire compression (the default)- See Also:
FirebirdConnectionProperties.isWireCompression()
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejavax.resource.spi.ManagedConnectionFactory
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejavax.resource.spi.ManagedConnectionFactory
- Overrides:
equals
in classjava.lang.Object
-
getDefaultConnectionRequestInfo
public FBConnectionRequestInfo getDefaultConnectionRequestInfo() throws javax.resource.ResourceException
- Throws:
javax.resource.ResourceException
-
getDefaultTpb
public FBTpb getDefaultTpb() throws javax.resource.ResourceException
- Throws:
javax.resource.ResourceException
-
getTpb
public FBTpb getTpb(int defaultTransactionIsolation) throws FBResourceException
- Throws:
FBResourceException
-
createConnectionFactory
public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager) throws javax.resource.ResourceException
ThecreateConnectionFactory
method creates a DataSource using the supplied ConnectionManager.- Specified by:
createConnectionFactory
in interfacejavax.resource.spi.ManagedConnectionFactory
- Parameters:
cxManager
- aConnectionManager
value- Returns:
- a
java.lang.Object
value - Throws:
javax.resource.ResourceException
- if an error occurs
-
createConnectionFactory
public java.lang.Object createConnectionFactory() throws javax.resource.ResourceException
ThecreateConnectionFactory
method creates a DataSource with a default stand alone ConnectionManager. Ours can implement pooling.- Specified by:
createConnectionFactory
in interfacejavax.resource.spi.ManagedConnectionFactory
- Returns:
- a new
javax.sql.DataSource
based around this connection factory - Throws:
javax.resource.ResourceException
- if an error occurs
-
createManagedConnection
public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
Creates a new physical connection to the underlying EIS resource manager, ManagedConnectionFactory uses the security information (passed as Subject) and additional ConnectionRequestInfo (which is specific to ResourceAdapter and opaque to application server) to create this new connection.- Specified by:
createManagedConnection
in interfacejavax.resource.spi.ManagedConnectionFactory
- Parameters:
subject
- Caller's security informationcri
- Additional resource adapter specific connection request information- Returns:
- ManagedConnection instance
- Throws:
javax.resource.ResourceException
- generic exceptionjavax.resource.spi.SecurityException
- security related errorjavax.resource.spi.ResourceAllocationException
- failed to allocate system resources for connection requestjavax.resource.spi.ResourceAdapterInternalException
- resource adapter related error conditionjavax.resource.spi.EISSystemException
- internal error condition in EIS instance
-
matchManagedConnections
public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
Returns a matched connection from the candidate set of connections. ManagedConnectionFactory uses the security info (as inSubject
) and information provided throughConnectionRequestInfo
and additional Resource Adapter specific criteria to do matching. Note that criteria used for matching is specific to a resource adapter and is not prescribed by theConnector
specification.This method returns a
ManagedConnection
instance that is the best match for handling the connection allocation request.- Specified by:
matchManagedConnections
in interfacejavax.resource.spi.ManagedConnectionFactory
- Parameters:
connectionSet
- candidate connection setsubject
- caller's security informationcxRequestInfo
- additional resource adapter specific connection request information- Returns:
- ManagedConnection if resource adapter finds an acceptable match otherwise null
- Throws:
javax.resource.ResourceException
- - generic exceptionjavax.resource.spi.SecurityException
- - security related errorjavax.resource.spi.ResourceAdapterInternalException
- - resource adapter related error conditionjavax.resource.NotSupportedException
- - if operation is not supported
-
setLogWriter
public void setLogWriter(java.io.PrintWriter out) throws javax.resource.ResourceException
Set the log writer for thisManagedConnectionFactory
instance. The log writer is a character output stream to which all logging and tracing messages for thisManagedConnectionFactory
instance will be printed. ApplicationServer manages the association of output stream with theManagedConnectionFactory
. When aManagedConnectionFactory
object is created the log writer is initiallynull
, in other words, logging is disabled. Once a log writer is associated with aManagedConnectionFactory
, logging and tracing forManagedConnectionFactory
instance is enabled.The
ManagedConnection
instances created byManagedConnectionFactory
"inherits" the log writer, which can be overridden by ApplicationServer usingManagedConnection.setLogWriter(java.io.PrintWriter)
to setManagedConnection
specific logging and tracing.- Specified by:
setLogWriter
in interfacejavax.resource.spi.ManagedConnectionFactory
- Parameters:
out
- an out stream for error logging and tracing- Throws:
javax.resource.ResourceException
- generic exceptionjavax.resource.spi.ResourceAdapterInternalException
- resource adapter related error condition
-
getLogWriter
public java.io.PrintWriter getLogWriter()
Get the log writer for thisManagedConnectionFactory
instance. The log writer is a character output stream to which all logging and tracing messages for thisManagedConnectionFactory
instance will be printed. ApplicationServer manages the association of output stream with theManagedConnectionFactory
. When aManagedConnectionFactory
object is created the log writer is initially null, in other words, logging is disabled.- Specified by:
getLogWriter
in interfacejavax.resource.spi.ManagedConnectionFactory
- Returns:
- PrintWriter instance
- Throws:
javax.resource.ResourceException
- generic exception
-
canonicalize
public FBManagedConnectionFactory canonicalize()
Thecanonicalize
method is used in FBDriver to reuse previous fbmcf instances if they have been create. It should really be package access level- Returns:
- a
FBManagedConnectionFactory
value
-
forget
public void forget(FBManagedConnection mc, javax.transaction.xa.Xid xid) throws GDSException
- Throws:
GDSException
-
recover
public void recover(FBManagedConnection mc, javax.transaction.xa.Xid xid) throws GDSException
- Throws:
GDSException
-
getCacheKey
public final FBConnectionProperties getCacheKey()
-
-