public interface DatabaseConnectionProperties extends AttachmentProperties
Modifier and Type | Method and Description |
---|---|
default int |
getBlobBufferSize() |
default java.lang.String |
getDatabaseName()
Gets the database of the connection.
|
default java.lang.String |
getDataTypeBind()
Get the
dataTypeBind configuration. |
default java.lang.String |
getDecfloatRound() |
default java.lang.String |
getDecfloatTraps() |
default java.lang.String |
getDefaultIsolation()
Get the default transaction isolation level as string.
|
default int |
getDefaultTransactionIsolation()
Get the default transaction isolation level.
|
default java.lang.String |
getGeneratedKeysEnabled()
Get the
generatedKeysEnabled configuration. |
default int |
getPageCacheSize()
Get the page cache size.
|
default java.lang.String |
getScrollableCursor() |
default int |
getServerBatchBufferSize() |
default java.lang.String |
getSessionTimeZone()
Get the
sessionTimeZone . |
default int |
getSqlDialect() |
default java.lang.String |
getTpbMapping()
Get the used TPB mapping.
|
default boolean |
isColumnLabelForName()
Gets the current setting of
columnLabelForName |
default boolean |
isDefaultResultSetHoldable()
Get whether ResultSets are holdable by default.
|
default boolean |
isExtendedMetadata() |
default boolean |
isIgnoreProcedureType()
Get the value for
ignoreProcedureType . |
default boolean |
isTimestampUsesLocalTimezone()
Deprecated.
This property has unclear semantics and will be removed in Jaybird 6
|
default boolean |
isUseFirebirdAutocommit()
Get whether to use Firebird autocommit (experimental).
|
default boolean |
isUseServerBatch() |
default boolean |
isUseStreamBlobs() |
default void |
setBlobBufferSize(int blobBufferSize) |
default void |
setColumnLabelForName(boolean columnLabelForName)
Set if
ResultSetMetaData.getColumnName(int) returns the columnLabel instead of the
columnName . |
default void |
setDatabaseName(java.lang.String databaseName)
Sets the database of the connection
|
default void |
setDataTypeBind(java.lang.String dataTypeBind)
Sets the
dataTypeBind configuration. |
default void |
setDecfloatRound(java.lang.String decfloatRound)
Sets the
DECFLOAT rounding mode |
default void |
setDecfloatTraps(java.lang.String decfloatTraps)
Sets the
DECFLOAT error traps. |
default void |
setDefaultIsolation(java.lang.String isolation)
Set the default transaction isolation level as string.
|
default void |
setDefaultResultSetHoldable(boolean defaultResultSetHoldable)
Set if
ResultSet should be ResultSet.HOLD_CURSORS_OVER_COMMIT by default. |
default void |
setDefaultTransactionIsolation(int defaultIsolationLevel)
Set the default transaction isolation level.
|
default void |
setExtendedMetadata(boolean extendedMetadata)
Sets if certain metadata classes will perform additional queries to enrich the information for certain types.
|
default void |
setGeneratedKeysEnabled(java.lang.String generatedKeysEnabled)
Sets the
generatedKeysEnabled configuration. |
default void |
setIgnoreProcedureType(boolean ignoreProcedureType)
Sets the value
ignoreProcedureType . |
default void |
setPageCacheSize(int pageCacheSize)
Set the page cache size.
|
default void |
setScrollableCursor(java.lang.String scrollableCursor)
Sets the type of scrollable cursor.
|
default void |
setServerBatchBufferSize(int serverBatchBufferSize)
Sets the server batch buffer size (if server batch is supported and enabled).
|
default void |
setSessionTimeZone(java.lang.String sessionTimeZone)
Sets the
sessionTimeZone . |
default void |
setSqlDialect(int sqlDialect) |
default void |
setTimestampUsesLocalTimezone(boolean timestampUsesLocalTimezone)
Deprecated.
This property has unclear semantics and will be removed in Jaybird 6
|
default void |
setTpbMapping(java.lang.String tpbMapping)
Set path to the properties file with the TPB mapping.
|
default void |
setUseFirebirdAutocommit(boolean useFirebirdAutocommit)
Set whether to use Firebird autocommit (experimental).
|
default void |
setUseServerBatch(boolean useServerBatch)
Sets whether to use server-side batch support, if available.
|
default void |
setUseStreamBlobs(boolean useStreamBlobs) |
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
default java.lang.String getDatabaseName()
setDatabaseName(String)
default void setDatabaseName(java.lang.String databaseName)
When serverName
is null
, the value is taken as the URL of the database, and exact
interpretation depends on the protocol implementation (type
). Basically, the URL would be the JDBC URL,
but without the jdbc:firebird[sql]:[subprotocol:]
prefix and without connection properties. Examples:
serverName
, depending on the Firebird version and platform, NATIVE may use Firebird Embedded)C
, depending on the Firebird version and platform, NATIVE may use Firebird Embedded)C
, depending on the Firebird version and platform, NATIVE may use Firebird Embedded)xnet
)fbclient
connection URLs — NATIVE (EMBEDDED will behave as NATIVE, protocols
like PURE_JAVA may interpret the protocol name as a host nametype
implementations may support other URL formats
Some protocols, for example PURE_JAVA, when serverName
is not set, but databaseName
doesn't seem
to contain a host name, may default to attempting to connect to localhost with databaseName
as the
database path or alias.
When serverName
is set, the value is taken as the database path or alias. Examples:
databaseName
- database namedefault int getSqlDialect()
default void setSqlDialect(int sqlDialect)
sqlDialect
- SQL dialect of the client connection.default int getPageCacheSize()
A value of 0
indicates that the value is not set, and that the server default is used.
This option is only relevant for Firebird implementations with per connection cache (eg Classic)
NOTE: Implementer should take care to return 0
if the value hasn't been set yet.
default void setPageCacheSize(int pageCacheSize)
A value of 0
indicates that the value is not set, and that the server default is used.
This option is only relevant for Firebird implementations with per connection cache (eg Classic).
pageCacheSize
- size of cache in pages for this connection, can be specified for Classic and SuperClassic instances
ignored for SuperServer as the cache is shared.default java.lang.String getDataTypeBind()
dataTypeBind
configuration.dataTypeBind
, or null
for driver defaultdefault void setDataTypeBind(java.lang.String dataTypeBind)
dataTypeBind
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
executing SET BIND
statements with the values.
See also Firebird documentation for SET BIND
.
dataTypeBind
- Firebird 4+ data type bind configuration, a semicolon-separated list of <from-type> TO <to-type>
default java.lang.String getSessionTimeZone()
sessionTimeZone
.sessionTimeZone
, or null
for driver default (JVM default time zone)default void setSessionTimeZone(java.lang.String sessionTimeZone)
sessionTimeZone
.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)default int getBlobBufferSize()
default void setBlobBufferSize(int blobBufferSize)
blobBufferSize
- size of the BLOB buffer in bytes.default boolean isUseStreamBlobs()
true
if stream blobs should be created, otherwise false
.default void setUseStreamBlobs(boolean useStreamBlobs)
useStreamBlobs
- true
if stream blobs should be created, otherwise false
.default boolean isDefaultResultSetHoldable()
true
ResultSets by default are ResultSet.HOLD_CURSORS_OVER_COMMIT
,
false
(default), ResultSets are ResultSet.CLOSE_CURSORS_AT_COMMIT
default void setDefaultResultSetHoldable(boolean defaultResultSetHoldable)
ResultSet
should be ResultSet.HOLD_CURSORS_OVER_COMMIT
by default.defaultResultSetHoldable
- true
ResultSets are holdable, false
(default) ResultSets are ResultSet.CLOSE_CURSORS_AT_COMMIT
default boolean isUseFirebirdAutocommit()
true
use Firebird autocommitdefault void setUseFirebirdAutocommit(boolean useFirebirdAutocommit)
useFirebirdAutocommit
- true
Use Firebird autocommitdefault boolean isColumnLabelForName()
columnLabelForName
false
JDBC compliant behavior (columnName
is returned), true
compatibility
option (columnLabel
is returned)setColumnLabelForName(boolean)
default void setColumnLabelForName(boolean columnLabelForName)
ResultSetMetaData.getColumnName(int)
returns the columnLabel
instead of the
columnName
.
The default behaviour (with columnLabelForName=false
is JDBC-compliant. The behavior for value
true
is to provide compatibility with tools with a wrong expectation.
columnLabelForName
- false
JDBC compliant behavior (columnName
is returned), true
compatibility
option (columnLabel
is returned)default java.lang.String getGeneratedKeysEnabled()
generatedKeysEnabled
configuration.generatedKeysEnabled
, or null
for driver defaultdefault void setGeneratedKeysEnabled(java.lang.String generatedKeysEnabled)
generatedKeysEnabled
configuration.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
)default boolean isIgnoreProcedureType()
ignoreProcedureType
.ignoreProcedureType
default void setIgnoreProcedureType(boolean ignoreProcedureType)
ignoreProcedureType
.
When set to true, the CallableStatement
implementation in Jaybird will ignore metadata
information about the stored procedure type and default to using EXECUTE PROCEDURE
, unless the type is
explicitly set using FirebirdCallableStatement.setSelectableProcedure(boolean)
. This can be useful in
situations where a stored procedure is selectable, but tooling or code expects an executable stored procedure.
ignoreProcedureType
- true
Ignore procedure typedefault java.lang.String getDecfloatRound()
DECFLOAT
rounding mode, null
applies the Firebird server defaultdefault void setDecfloatRound(java.lang.String decfloatRound)
DECFLOAT
rounding modedecfloatRound
- Firebird 4+ server-side DECFLOAT
rounding mode (ceiling, up, half_up, half_even,
half_down, down, floor, reround
); null
to apply the Firebird server default (half_up
in
Firebird 4)default java.lang.String getDecfloatTraps()
DECFLOAT
error traps, null
applies the Firebird server defaultdefault void setDecfloatTraps(java.lang.String decfloatTraps)
DECFLOAT
error traps.decfloatTraps
- Firebird 4+ server-side DECFLOAT
error traps; comma-separated list with options
Division_by_zero, Inexact, Invalid_operation, Overflow, Underflow
; null
to apply
Firebird server default (Division_by_zero,Invalid_operation,Overflow
in Firebird 4)default java.lang.String getTpbMapping()
setTpbMapping(String)
default void setTpbMapping(java.lang.String tpbMapping)
"res:"
should be used to specify resource in the
classpath.
For 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 the
Connection
interface and a comma-separated list of TPB parameters).tpbMapping
- path to the properties filejava.lang.IllegalStateException
- May be thrown when the mapping has already been initialized (not all implementations do this)default int getDefaultTransactionIsolation()
default void setDefaultTransactionIsolation(int defaultIsolationLevel)
defaultIsolationLevel
- default transaction isolation level.default java.lang.String getDefaultIsolation()
getDefaultTransactionIsolation()
, however it returns a string name instead of a numeric constant.setDefaultIsolation(String)
default void setDefaultIsolation(java.lang.String isolation)
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.
isolation
- string constant representing a default isolation level.@Deprecated default boolean isTimestampUsesLocalTimezone()
true
if the Jaybird 1.0 handling of the calendar in corresponding setters. This is also
compatible with MySQL calendar treatment.@Deprecated default void setTimestampUsesLocalTimezone(boolean timestampUsesLocalTimezone)
timestampUsesLocalTimezone
.timestampUsesLocalTimezone
- true
if the Jaybird 1.0 handling of the calendar in corresponding setters. This is also
compatible with MySQL calendar treatment.default java.lang.String getScrollableCursor()
EMULATED
(default) or SERVER
(case-insensitive)setScrollableCursor(String)
default void setScrollableCursor(java.lang.String scrollableCursor)
Possible values are (case-insensitive):
EMULATED
(default) - emulate scrollable cursors in memory by fetching all rowsSERVER
- user server-side scrollable cursor (requires Firebird 5.0 and pure-java connection).
Falls back to EMULATED
behaviour when server-side support is not available, or when holdable cursors are
requestedscrollableCursor
- Scrollable cursor type, one of EMULATED
or SERVER
(case-insensitive)default boolean isUseServerBatch()
true
(default) use server-side batch if supported by server, false
always use emulated batchsetUseServerBatch(boolean)
default void setUseServerBatch(boolean useServerBatch)
Currently, server-side batch is only supported with Firebird 4.0 or higher, with a pure Java connection, using
a PreparedStatement
, but not a CallableStatement
, and only when not requesting
generated keys.
The implementation will fall back to emulated batches if either the server version doesn't support batches, or if the statement cannot be executed using the server-side batch mechanism for other reasons (e.g. requesting generated keys).
useServerBatch
- true
, use server-side batch support if possible, false
always use emulated
batchdefault int getServerBatchBufferSize()
< 0
to use server-side default (16MB as of Firebird 4.0),
0
(default) to use server-side maximum (256MB as of Firebird 4.0), values exceeding server-side maximum
will set server-side maximumsetServerBatchBufferSize(int)
default void setServerBatchBufferSize(int serverBatchBufferSize)
serverBatchBufferSize
- server batch buffer size in bytes, use < 0
to set server-side default (16MB as of Firebird 4.0),
use 0
to use server-side maximum (256MB as of Firebird 4.0), values exceeding server-side maximum
will set server-side maximumdefault boolean isExtendedMetadata()
true
(default) if metadata (e.g. ResultSetMetaData
) will perform additional queries for
more detailed information, false
if only the available bind information will be usedsetExtendedMetadata(boolean)
default void setExtendedMetadata(boolean extendedMetadata)
Currently this is used only by ResultSetMetaData
for its getPrecision
and isAutoIncrement
methods. If disabled, these methods will return an estimated precision, or false
for auto-increment
instead of actual precision and identity column state information.
Disabling this setting may improve performance of querying metadata information, in exchange for less precise information.
extendedMetadata
- true
(default) - metadata (e.g. ResultSetMetaData
) will perform additional queries for
more detailed information, false
- only the available bind information will be usedCopyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.