public abstract class FBAbstractCommonDataSource extends AbstractConnectionPropertiesDataSource
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
REF_DESCRIPTION |
protected static java.lang.String |
REF_PROPERTIES |
Constructor and Description |
---|
FBAbstractCommonDataSource() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkNotStarted()
Method to check if this DataSource has not yet started.
|
java.util.Map<ConnectionProperty,java.lang.Object> |
connectionPropertyValues()
An unmodifiable view on the connection properties held by this BaseProperties implementation.
|
java.lang.Boolean |
getBooleanProperty(java.lang.String name)
Retrieves a
boolean property value by name. |
protected FBConnectionProperties |
getConnectionProperties() |
java.lang.String |
getDescription() |
java.lang.Integer |
getIntProperty(java.lang.String name)
Retrieves an
int property value by name. |
java.lang.String |
getProperty(java.lang.String name)
Retrieves a string property value by name.
|
TransactionParameterBuffer |
getTransactionParameters(int isolation)
Get the transaction parameter buffer corresponding to the current
connection request information.
|
void |
setBooleanProperty(java.lang.String name,
java.lang.Boolean value)
Sets a
boolean property by name. |
protected void |
setConnectionProperties(FBConnectionProperties connectionProperties) |
void |
setDescription(java.lang.String description) |
void |
setIntProperty(java.lang.String name,
java.lang.Integer value)
Sets an
int property by name. |
void |
setNonStandardProperty(java.lang.String propertyMapping)
Method that allows setting non-standard property in the form "key=value"
form.
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property by name.
|
void |
setTransactionParameters(int isolation,
TransactionParameterBuffer tpb)
Set transaction parameters for the specified transaction isolation level.
|
protected static void |
updateReference(javax.naming.Reference ref,
FBAbstractCommonDataSource instance)
Updates the supplied reference with RefAddr properties relevant to this class.
|
protected LockCloseable |
withLock() |
getAuthPlugins, getBlobBufferSize, getBuffersNumber, getCharSet, getConnectTimeout, getDatabase, getDatabaseName, getDataTypeBind, getDbCryptConfig, getDecfloatRound, getDecfloatTraps, getDefaultIsolation, getDefaultTransactionIsolation, getEncoding, getGeneratedKeysEnabled, getLoginTimeout, getPageCacheSize, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getScrollableCursor, getServerBatchBufferSize, getServerName, getSessionTimeZone, getSocketBufferSize, getSoTimeout, getSqlDialect, getTpbMapping, getType, getUser, getUserName, getWireCrypt, isColumnLabelForName, isDefaultResultSetHoldable, isIgnoreProcedureType, isTimestampUsesLocalTimezone, isUseFirebirdAutocommit, isUseServerBatch, isUseStreamBlobs, isWireCompression, setAuthPlugins, setBlobBufferSize, setBuffersNumber, setCharSet, setColumnLabelForName, setConnectTimeout, setDatabase, setDatabaseName, setDataTypeBind, setDbCryptConfig, setDecfloatRound, setDecfloatTraps, setDefaultIsolation, setDefaultResultSetHoldable, setDefaultTransactionIsolation, setEncoding, setGeneratedKeysEnabled, setIgnoreProcedureType, setLoginTimeout, setPageCacheSize, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setScrollableCursor, setServerBatchBufferSize, setServerName, setSessionTimeZone, setSocketBufferSize, setSoTimeout, setSqlDialect, setTimestampUsesLocalTimezone, setTpbMapping, setType, setUseFirebirdAutocommit, setUser, setUserName, setUseServerBatch, setUseStreamBlobs, setWireCompression, setWireCrypt
getLogWriter, getParentLogger, setLogWriter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNonStandardProperty, setNonStandardProperty
getBooleanProperty, getIntProperty, getProperty
protected static final java.lang.String REF_DESCRIPTION
protected static final java.lang.String REF_PROPERTIES
protected final LockCloseable withLock()
protected abstract void checkNotStarted() throws java.lang.IllegalStateException
Implementations should throw IllegalStateException when the DataSource is already in use and modifying properties is not allowed.
java.lang.IllegalStateException
- When the DataSource is already in usepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
public TransactionParameterBuffer getTransactionParameters(int isolation)
FirebirdConnectionProperties
isolation
- transaction isolation level for which TPB should be returned.TransactionParameterBuffer
.public void setTransactionParameters(int isolation, TransactionParameterBuffer tpb)
FirebirdConnectionProperties
isolation
- transaction isolation level.tpb
- instance of TransactionParameterBuffer
containing
transaction parameters.public final void setNonStandardProperty(java.lang.String propertyMapping)
propertyMapping
- mapping between property name (key) and its value. Name and value are separated with "=", ":" or
whitespace character. Whitespace characters on the beginning of the string and between key and value are
ignored. No escaping is possible: "\n" is backslash-en, not a new line mark.setProperty(String, String)
public java.lang.String getProperty(java.lang.String name)
BaseProperties
For properties with an explicit default, this method should return the string presentation of that default, not
null
. For int
or boolean
the string equivalent is returned.
name
- Property name (not null
or empty)null
when not set or not a known propertypublic void setProperty(java.lang.String name, java.lang.String value)
BaseProperties
This method can be used to set all defined properties, but also properties not known by Jaybird. When setting
int
or boolean
properties, the appropriate conversions are applied. Using null
will
reset to the default value. For boolean
properties, an empty string is taken to mean true
.
name
- Property name (not null
or empty)value
- Property value (use null
to apply default)public java.lang.Integer getIntProperty(java.lang.String name)
BaseProperties
int
property value by name.
For properties with an explicit default, this method should return the integer presentation of that default. For
implementation simplicity, it is allowed to convert any string property to int
instead of checking if
something is actually an int
property
name
- Property name (not null
or empty)null
when not setpublic void setIntProperty(java.lang.String name, java.lang.Integer value)
BaseProperties
int
property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
name
- Property name (not null
or empty)value
- Property value (use null
to apply default)public java.lang.Boolean getBooleanProperty(java.lang.String name)
BaseProperties
boolean
property value by name.
For properties with an explicit default, this method should return the boolean presentation of that default. For
implementation simplicity, it is allowed to convert any string property to boolean
instead of checking
if something is actually an int
property
name
- Property name (not null
or empty)null
when not setpublic void setBooleanProperty(java.lang.String name, java.lang.Boolean value)
BaseProperties
boolean
property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
name
- Property name (not null
or empty)value
- Property value (use null
to apply default)public java.util.Map<ConnectionProperty,java.lang.Object> connectionPropertyValues()
BaseProperties
Be aware, implementations can have additional properties that are not mapped from ConnectionProperty
.
Such properties will need to be retrieved in an implementation-specific manner.
protected final void setConnectionProperties(FBConnectionProperties connectionProperties)
protected final FBConnectionProperties getConnectionProperties()
protected static void updateReference(javax.naming.Reference ref, FBAbstractCommonDataSource instance) throws javax.naming.NamingException
ref
- Reference to updateinstance
- Instance of this class to obtain valuesjavax.naming.NamingException
Copyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.