Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.firebirdsql.jca.FBManagedConnectionFactory
public class FBManagedConnectionFactory
extends java.lang.Object
implements ManagedConnectionFactory, Serializable, FirebirdConnectionProperties
Constructor Summary | |
| |
| |
|
Method Summary | |
FBManagedConnectionFactory |
|
Object |
|
Object |
|
ManagedConnection |
|
boolean |
|
void |
|
int |
|
int | |
int | |
String | |
String | |
DatabaseParameterBuffer |
|
FBConnectionRequestInfo | |
String |
|
FBTpb | |
int |
|
String | |
GDS |
|
org.firebirdsql.gds.impl.GDSType |
|
String |
|
PrintWriter |
|
String |
|
String | |
String | |
int | |
String | |
FBTpb |
|
String |
|
Integer |
|
String |
|
TransactionParameterBuffer |
|
String |
|
String | |
String | |
int |
|
boolean | |
boolean | |
boolean | |
boolean | |
ManagedConnection |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public FBManagedConnectionFactory()
Create a new pure-Java FBManagedConnectionFactory.
public FBManagedConnectionFactory(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new FBManagedConnectionFactory based around the given GDSType.
- Parameters:
gdsType
- The GDS implementation to use
public FBManagedConnectionFactory(org.firebirdsql.gds.impl.GDSType gdsType, FBConnectionProperties connectionProperties)
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
public Object createConnectionFactory() throws ResourceException
ThecreateConnectionFactory
method creates a DataSource with a default stand alone ConnectionManager. Ours can implement pooling.
- Returns:
- a new
javax.sql.DataSource
based around this connection factory
public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
ThecreateConnectionFactory
method creates a DataSource using the supplied ConnectionManager.
- Parameters:
cxManager
- aConnectionManager
value
- Returns:
- a
java.lang.Object
value
public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri) throws 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.
- Parameters:
subject
- Caller's security informationcri
- Additional resource adapter specific connection request information
- Returns:
- ManagedConnection instance
public boolean equals(Object other)
public int getBlobBufferSize()
- Specified by:
- getBlobBufferSize in interface FirebirdConnectionProperties
- Returns:
- BLOB buffer size in bytes.
public int getBuffersNumber()
- Specified by:
- getBuffersNumber in interface FirebirdConnectionProperties
- 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.
public String getCharSet()
- Specified by:
- getCharSet in interface FirebirdConnectionProperties
- Returns:
- Character set for the connection.
public String getDatabase()
- Specified by:
- getDatabase in interface FirebirdConnectionProperties
- Returns:
- path to the database including the server name and the port, if needed.
public DatabaseParameterBuffer getDatabaseParameterBuffer() throws SQLException
Get the database parameter buffer corresponding to the current connection request information.
- Specified by:
- getDatabaseParameterBuffer in interface FirebirdConnectionProperties
- Returns:
- instance of
DatabaseParameterBuffer
.
public FBConnectionRequestInfo getDefaultConnectionRequestInfo() throws ResourceException
public String getDefaultIsolation()
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 interface FirebirdConnectionProperties
- Returns:
- default transaction isolation as string.
public int getDefaultTransactionIsolation()
Get the default transaction isolation level. This is the transaction isolation level for the newly created connections.
- Specified by:
- getDefaultTransactionIsolation in interface FirebirdConnectionProperties
- Returns:
- default transaction isolation level.
public String getEncoding()
- Specified by:
- getEncoding in interface FirebirdConnectionProperties
- Returns:
- Character encoding for the connection.
public org.firebirdsql.gds.impl.GDSType getGDSType()
Get the GDS implementation type around which this factory is based.
- Returns:
- The GDS implementation type
public 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.
- Returns:
- PrintWriter instance
public String getNonStandardProperty(String key)
Get the property that does not have corresponding getter method by its name.
- Specified by:
- getNonStandardProperty in interface FirebirdConnectionProperties
- Parameters:
key
- name of the property to get.
- Returns:
- value of the property.
public String getPassword()
- Specified by:
- getPassword in interface FirebirdConnectionProperties
- Returns:
- password corresponding to the specified user name.
public String getRoleName()
- Specified by:
- getRoleName in interface FirebirdConnectionProperties
- Returns:
- SQL role to use.
public int getSocketBufferSize()
- Specified by:
- getSocketBufferSize in interface FirebirdConnectionProperties
- Returns:
- socket buffer size in bytes, or -1 is not specified.
public String getSqlDialect()
- Specified by:
- getSqlDialect in interface FirebirdConnectionProperties
- Returns:
- SQL dialect of the client.
public String getTpbMapping()
Get the used TPB mapping.
- Specified by:
- getTpbMapping in interface FirebirdConnectionProperties
- Returns:
- path to the TPB mapping.
public Integer getTransactionIsolation()
Deprecated. use
getDefaultTransactionIsolation()
public String getTransactionIsolationName()
Deprecated. use
getDefaultIsolation()
public TransactionParameterBuffer getTransactionParameters(int isolation)
Get the transaction parameter buffer corresponding to the current connection request information.
- Specified by:
- getTransactionParameters in interface FirebirdConnectionProperties
- Parameters:
isolation
- transaction isolation level for which TPB should be returned.
- Returns:
- instance of
TransactionParameterBuffer
.
public String getType()
- Specified by:
- getType in interface FirebirdConnectionProperties
- Returns:
- type of the connection, for example, "PURE_JAVA", "LOCAL", "EMBEDDED", depends on the GDS implementations installed in the system.
public String getUseTranslation()
- Specified by:
- getUseTranslation in interface FirebirdConnectionProperties
- Returns:
- path to the character translation table.
public String getUserName()
- Specified by:
- getUserName in interface FirebirdConnectionProperties
- Returns:
- name of the user that will be used when connecting to the database.
public int hashCode()
public boolean isDefaultResultSetHoldable()
- Specified by:
- isDefaultResultSetHoldable in interface FirebirdConnectionProperties
public boolean isTimestampUsesLocalTimezone()
- Specified by:
- isTimestampUsesLocalTimezone in interface FirebirdConnectionProperties
- Returns:
true
if the Jaybird 1.0 handling of the calendar in corresponding setters. This is also compatible with MySQL calendar treatment.
public boolean isUseStandardUdf()
- Specified by:
- isUseStandardUdf in interface FirebirdConnectionProperties
- Returns:
true
if driver should assume that standard UDF are installed.
public boolean isUseStreamBlobs()
- Specified by:
- isUseStreamBlobs in interface FirebirdConnectionProperties
- Returns:
true
if stream blobs should be created, otherwisefalse
.
public ManagedConnection matchManagedConnections(Set connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws 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 aManagedConnection
instance that is the best match for handling the connection allocation request.
- 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
public void setBlobBufferSize(int bufferSize)
- Specified by:
- setBlobBufferSize in interface FirebirdConnectionProperties
- Parameters:
bufferSize
- size of the BLOB buffer in bytes.
public void setBuffersNumber(int buffersNumber)
- Specified by:
- setBuffersNumber in interface FirebirdConnectionProperties
- 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.
public void setCharSet(String charSet)
- Specified by:
- setCharSet in interface FirebirdConnectionProperties
- Parameters:
charSet
- Character set for the connection. Similar toencoding
property, but accepts Java names instead of Firebird ones.
public void setDatabase(String database)
- Specified by:
- setDatabase in interface FirebirdConnectionProperties
- Parameters:
database
- path to the database including the server name and the port, if needed.
public void setDefaultConnectionManager(ConnectionManager defaultCm)
public void setDefaultIsolation(String isolation)
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 interface FirebirdConnectionProperties
- Parameters:
isolation
- string constant representing a default isolation level.
public void setDefaultResultSetHoldable(boolean isHoldable)
- Specified by:
- setDefaultResultSetHoldable in interface FirebirdConnectionProperties
public void setDefaultTransactionIsolation(int defaultIsolationLevel)
Set the default transaction isolation level.
- Specified by:
- setDefaultTransactionIsolation in interface FirebirdConnectionProperties
- Parameters:
defaultIsolationLevel
- default transaction isolation level.
public void setEncoding(String encoding)
- Specified by:
- setEncoding in interface FirebirdConnectionProperties
- Parameters:
encoding
- Character encoding for the connection. See Firebird documentation for more information.
public void setLocalEncoding(String localEncoding)
Deprecated. use
setCharSet(String)
instead.
public void setLogWriter(PrintWriter out) throws 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. TheManagedConnection
instances created byManagedConnectionFactory
"inherits" the log writer, which can be overridden by ApplicationServer usingManagedConnection.setLogWriter
to setManagedConnection
specific logging and tracing.
- Parameters:
out
- an out stream for error logging and tracing
public void setNonStandardProperty(String propertyMapping)
Set the property that does not have corresponding setter method.
- Specified by:
- setNonStandardProperty in interface FirebirdConnectionProperties
- Parameters:
propertyMapping
- parameter value in the ?propertyName[=propertyValue]? form, this allows setting non-standard parameters using configuration files.
public void setNonStandardProperty(String key, String value)
Set the property that does not have corresponding setter method.
- Specified by:
- setNonStandardProperty in interface FirebirdConnectionProperties
- Parameters:
key
- name of the property to set.value
- value of the property.
public void setPassword(String password)
- Specified by:
- setPassword in interface FirebirdConnectionProperties
- Parameters:
password
- password corresponding to the specified user name.
public void setRoleName(String roleName)
- Specified by:
- setRoleName in interface FirebirdConnectionProperties
- Parameters:
roleName
- SQL role to use.
public void setSocketBufferSize(int socketBufferSize)
- Specified by:
- setSocketBufferSize in interface FirebirdConnectionProperties
- Parameters:
socketBufferSize
- socket buffer size in bytes.
public void setSqlDialect(String sqlDialect)
- Specified by:
- setSqlDialect in interface FirebirdConnectionProperties
- Parameters:
sqlDialect
- SQL dialect of the client.
public void setTimestampUsesLocalTimezone(boolean timestampUsesLocalTimezone)
- Specified by:
- setTimestampUsesLocalTimezone in interface FirebirdConnectionProperties
- Parameters:
timestampUsesLocalTimezone
-true
if the Jaybird 1.0 handling of the calendar in corresponding setters. This is also compatible with MySQL calendar treatment.
public void setTpbMapping(String tpbMapping)
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 thejava.sql.Connection
interface and a comma-separated list of TPB parameters.
- Specified by:
- setTpbMapping in interface FirebirdConnectionProperties
- Parameters:
tpbMapping
- path to the properties file.
public void setTransactionIsolation(Integer value)
Deprecated. use
setDefaultTransactionIsolation(int)
public void setTransactionIsolationName(String name)
Deprecated. use
setDefaultIsolation(String)
public void setTransactionParameters(int isolation, TransactionParameterBuffer tpb)
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 interface FirebirdConnectionProperties
- Parameters:
isolation
- transaction isolation level.tpb
- instance ofTransactionParameterBuffer
containing transaction parameters.
public void setType(String type)
- Specified by:
- setType in interface FirebirdConnectionProperties
- Parameters:
type
- type of the connection, for example, "PURE_JAVA", "LOCAL", "EMBEDDED", depends on the GDS implementations installed in the system.
public void setUseStandardUdf(boolean useStandardUdf)
- Specified by:
- setUseStandardUdf in interface FirebirdConnectionProperties
- Parameters:
useStandardUdf
-true
if driver should assume that standard UDF are installed.
public void setUseStreamBlobs(boolean useStreamBlobs)
- Specified by:
- setUseStreamBlobs in interface FirebirdConnectionProperties
- Parameters:
useStreamBlobs
-true
if stream blobs should be created, otherwisefalse
.
public void setUseTranslation(String translationPath)
- Specified by:
- setUseTranslation in interface FirebirdConnectionProperties
- Parameters:
translationPath
- path to the character translation table.
public void setUserName(String userName)
- Specified by:
- setUserName in interface FirebirdConnectionProperties
- Parameters:
userName
- name of the user that will be used when connecting to the database.