Class AbstractConnectionPropertiesDataSource
- All Implemented Interfaces:
CommonDataSource,AttachmentProperties,BaseProperties,DatabaseConnectionProperties,FirebirdConnectionProperties
- Direct Known Subclasses:
FBAbstractCommonDataSource,FBSimpleDataSource
FirebirdConnectionProperties to ensure subclasses can be introspected as beans.- Since:
- 5
- Author:
- Mark Rotteveel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the list of authentication plugins to try.intJava character set configured for the connection.intGet the connect timeout in seconds.Gets the database of the connection.Get thedataTypeBindconfiguration.Get the database encryption plugin configuration.Get the default transaction isolation level as string.intGet the default transaction isolation level.Comma-separated list of additionally enabled protocols.Firebird character set configured for the connection.Get thegeneratedKeysEnabledconfiguration.intintGet the page cache size.intintGet the port number of the server.intGet the hostname or IP address of the Firebird server.Get thesessionTimeZone.intGet the socket buffer size.The class name of a custom socket factory to be used for pure Java connections.intGet the initial Socket blocking timeout (SoTimeout).intGet the used TPB mapping.getType()getUser()Deprecated.Get the wire encryption level.booleanbooleanGets if async fetching is enabled or disabled (pure Java only).booleanGets the current setting ofcolumnLabelForNamebooleanbooleanGet whether ResultSets are holdable by default.booleanbooleanGet the value forignoreProcedureType.booleanbooleanGet whether to use Firebird autocommit (experimental).booleanbooleanbooleanGet if wire compression should be enabled.voidsetAllowTxStmts(boolean allowTxStmts) Sets whether transaction management statements with (hard) transaction boundaries are allowed to be prepared or executed.voidsetAsyncFetch(boolean asyncFetch) Sets if async fetching is enabled or disabled (pure Java only).voidsetAuthPlugins(String authPlugins) Sets the authentication plugins to try.voidsetBlobBufferSize(int blobBufferSize) voidsetCharSet(String charSet) Set the Java character set for the connection.voidsetColumnLabelForName(boolean columnLabelForName) voidsetConnectTimeout(int connectTimeout) Set the connect timeout in seconds.voidsetCreateDatabaseIfNotExist(boolean createDatabaseIfNotExist) Sets if an attempt should be made to create a database if it does not exist.voidsetDatabaseName(String databaseName) Sets the database of the connectionvoidsetDataTypeBind(String dataTypeBind) Sets thedataTypeBindconfiguration.voidsetDbCryptConfig(String dbCryptConfig) Sets the database encryption plugin configuration.voidsetDecfloatRound(String decfloatRound) Sets theDECFLOATrounding modevoidsetDecfloatTraps(String decfloatTraps) Sets theDECFLOATerror traps.voidsetDefaultIsolation(String isolation) Set the default transaction isolation level as string.voidsetDefaultResultSetHoldable(boolean defaultResultSetHoldable) Set ifResultSetshould beResultSet.HOLD_CURSORS_OVER_COMMITby default.voidsetDefaultTransactionIsolation(int defaultIsolationLevel) Set the default transaction isolation level.voidsetEnableProtocol(String enableProtocol) Comma-separated list of additionally enabled protocols.voidsetEncoding(String encoding) Set the Firebird character set for the connection.voidsetExtendedMetadata(boolean extendedMetadata) Sets if certain metadata classes will perform additional queries to enrich the information for certain types.voidsetGeneratedKeysEnabled(String generatedKeysEnabled) Sets thegeneratedKeysEnabledconfiguration.voidsetIgnoreProcedureType(boolean ignoreProcedureType) Sets the valueignoreProcedureType.voidsetLoginTimeout(int seconds) voidsetPageCacheSize(int pageCacheSize) Set the page cache size.voidsetParallelWorkers(int parallelWorkers) Sets the number of parallel workers of the connection.voidsetPassword(String password) voidsetPortNumber(int portNumber) Set the port number of the server.voidsetProcessId(Integer processId) Sets a custom process id to send to Firebird on attach.voidsetProcessName(String processName) Sets a custom process name to send to Firebird on attachvoidsetReportSQLWarnings(String reportSQLWarnings) Sets ifSQLWarningshould be reported byConnection.getWarnings(),Statement.getWarnings(), andResultSet.getWarnings().voidsetRoleName(String roleName) voidsetScrollableCursor(String scrollableCursor) Sets the type of scrollable cursor.voidsetServerBatchBufferSize(int serverBatchBufferSize) Sets the server batch buffer size (if server batch is supported and enabled).voidsetServerName(String serverName) Set the hostname or IP address of the Firebird server.voidsetSessionTimeZone(String sessionTimeZone) Sets thesessionTimeZone.voidsetSocketBufferSize(int socketBufferSize) Set the socket buffer size.voidsetSocketFactory(String socketFactory) Sets the class name of a custom socket factory to be used for pure Java connections.voidsetSoTimeout(int soTimeout) Set the initial Socket blocking timeout (SoTimeout).voidsetSqlDialect(int sqlDialect) voidsetTpbMapping(String tpbMapping) Sets a resource bundle name with the TPB mapping.voidvoidsetUseCatalogAsPackage(boolean useCatalogAsPackage) Sets whether to use catalogs to report packages in database metadata.voidsetUseFirebirdAutocommit(boolean useFirebirdAutocommit) Set whether to use Firebird autocommit (experimental).voidvoidsetUserName(String userName) Deprecated.voidsetUseServerBatch(boolean useServerBatch) Sets whether to use server-side batch support, if available.voidsetUseStreamBlobs(boolean useStreamBlobs) voidsetWireCompression(boolean wireCompression) Sets if the connection should try to enable wire compression.voidsetWireCrypt(String wireCrypt) Set the wire encryption level.Methods inherited from class org.firebirdsql.ds.RootCommonDataSource
getLogWriter, getParentLogger, setLogWriterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.jaybird.props.BaseProperties
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setPropertyMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface org.firebirdsql.jdbc.FirebirdConnectionProperties
getTransactionParameters, setNonStandardProperty, setTransactionParameters
-
Constructor Details
-
AbstractConnectionPropertiesDataSource
public AbstractConnectionPropertiesDataSource()
-
-
Method Details
-
getServerName
Description copied from interface:AttachmentPropertiesGet the hostname or IP address of the Firebird server.- Specified by:
getServerNamein interfaceAttachmentProperties- Returns:
- Hostname or IP address of the server
- See Also:
-
setServerName
Description copied from interface:AttachmentPropertiesSet the hostname or IP address of the Firebird server.When set to
null(the default), thedatabaseNameorserviceNameis used as the full identification of the database host, port and database path/alias. Protocol implementations, for examplePURE_JAVA, may default tolocalhostwhen this property isnull, butdatabaseName/serviceNamedoes not (seem to) contain a host name.- Specified by:
setServerNamein interfaceAttachmentProperties- Parameters:
serverName- Hostname or IP address of the server
-
getPortNumber
public int getPortNumber()Description copied from interface:AttachmentPropertiesGet the port number of the server.- Specified by:
getPortNumberin interfaceAttachmentProperties- Returns:
- Port number of the server
- See Also:
-
setPortNumber
public void setPortNumber(int portNumber) Description copied from interface:AttachmentPropertiesSet the port number of the server.Defaults to
3050. This property value will be ignored ifserverNameisnull, unless the protocol implementation needs a hostname, but cannot find a hostname indatabaseName/serviceName.- Specified by:
setPortNumberin interfaceAttachmentProperties- Parameters:
portNumber- Port number of the server- See Also:
-
getDatabaseName
Description copied from interface:DatabaseConnectionPropertiesGets the database of the connection.- Specified by:
getDatabaseNamein interfaceDatabaseConnectionProperties- Returns:
- database name
- See Also:
-
setDatabaseName
Description copied from interface:DatabaseConnectionPropertiesSets the database of the connectionWhen
serverNameisnull, 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 thejdbc:firebird[sql]:[subprotocol:]prefix and without connection properties. Examples:- //localhost/employee — PURE_JAVA, NATIVE (for NATIVE, this format is parsed and transformed to the next example)
- localhost:employee — NATIVE, PURE_JAVA
- //localhost:3051/employee — PURE_JAVA, NATIVE (for NATIVE, this format is parsed and transformed to the next example)
- localhost/3051:employee — NATIVE, PURE_JAVA
- /path/to/your.fdb — NATIVE, EMBEDDED, PURE_JAVA (PURE_JAVA will use localhost
as
serverName, depending on the Firebird version and platform, NATIVE may use Firebird Embedded) - C:\path\to\your.fdb — NATIVE, EMBEDDED (protocols like PURE_JAVA may attempt to connect to a server
called
C, depending on the Firebird version and platform, NATIVE may use Firebird Embedded) - C:/path/to/your.fdb — NATIVE, EMBEDDED (protocols like PURE_JAVA may attempt to connect to a server
called
C, depending on the Firebird version and platform, NATIVE may use Firebird Embedded) - xnet://employee — NATIVE (EMBEDDED will behave as NATIVE, protocols like PURE_JAVA may
attempt to connect to a server called
xnet) - other Firebird
fbclientconnection URLs — NATIVE (EMBEDDED will behave as NATIVE, protocols like PURE_JAVA may interpret the protocol name as a host name - Custom
typeimplementations may support other URL formats
Some protocols, for example PURE_JAVA, when
serverNameis not set, butdatabaseNamedoesn't seem to contain a host name, may default to attempting to connect to localhost withdatabaseNameas the database path or alias.When
serverNameis set, the value is taken as the database path or alias. Examples:- employee
- /path/to/your.fdb
- C:\path\to\your.fdb
- C:/path/to/your.fdb
- relative/path/to/your.fdb — not recommended
- Specified by:
setDatabaseNamein interfaceDatabaseConnectionProperties- Parameters:
databaseName- database name
-
getType
- Specified by:
getTypein interfaceAttachmentProperties- Returns:
- type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS implementations installed in the system.
-
setType
- Specified by:
setTypein interfaceAttachmentProperties- Parameters:
type- type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS implementations installed in the system.
-
getUser
- Specified by:
getUserin interfaceAttachmentProperties- Returns:
- Name of the user to authenticate to the server.
-
setUser
- Specified by:
setUserin interfaceAttachmentProperties- Parameters:
user- Name of the user to authenticate to the server.
-
getPassword
- Specified by:
getPasswordin interfaceAttachmentProperties- Returns:
- Password to authenticate to the server.
-
setPassword
- Specified by:
setPasswordin interfaceAttachmentProperties- Parameters:
password- Password to authenticate to the server.
-
getRoleName
- Specified by:
getRoleNamein interfaceAttachmentProperties- Returns:
- SQL role to use.
-
setRoleName
- Specified by:
setRoleNamein interfaceAttachmentProperties- Parameters:
roleName- SQL role to use.
-
getCharSet
Description copied from interface:AttachmentPropertiesJava character set configured for the connection.After connect, the actual Java character set applied can be obtained from
FbAttachment.getEncoding()(propertycharsetName), orFbAttachment.getEncodingFactory()(propertiesdefaultEncoding.charsetNameor {code defaultEncodingDefinition.javaCharset}).- Specified by:
getCharSetin interfaceAttachmentProperties- Returns:
- Java character set for the connection (
nullwhen not explicitly configured).
-
setCharSet
Description copied from interface:AttachmentPropertiesSet the Java character set for the connection.It is possible to set both the
charSetandencodingto achieve a character set conversion effect, but in general only one of both properties should be set.- Specified by:
setCharSetin interfaceAttachmentProperties- Parameters:
charSet- Character set for the connection. Similar toencodingproperty, but accepts Java names instead of Firebird ones.- See Also:
-
getEncoding
Description copied from interface:AttachmentPropertiesFirebird character set configured for the connection.After connect, the actual Firebird character set applied can be obtained from
FbAttachment.getEncodingFactory(), propertydefaultEncodingDefinition.firebirdEncodingName.- Specified by:
getEncodingin interfaceAttachmentProperties- Returns:
- Firebird character encoding for the connection (
nullwhen not explicitly configured).
-
setEncoding
Description copied from interface:AttachmentPropertiesSet the Firebird character set for the connection.It is possible to set both the
charSetandencodingto achieve a character set conversion effect, but in general only one of both properties should be set.- Specified by:
setEncodingin interfaceAttachmentProperties- Parameters:
encoding- Firebird character encoding for the connection. See Firebird documentation for more information.- See Also:
-
getProcessId
- Specified by:
getProcessIdin interfaceAttachmentProperties- Returns:
- Custom process id sent to Firebird on attach;
nullmeans the default is applied (read from system propertyorg.firebirdsql.jdbc.pid, future versions may also determine the actual process id)
-
setProcessId
Description copied from interface:AttachmentPropertiesSets a custom process id to send to Firebird on attach.- Specified by:
setProcessIdin interfaceAttachmentProperties- Parameters:
processId- The process id to send;nullto apply the default behaviour (seeAttachmentProperties.getProcessId())
-
getProcessName
- Specified by:
getProcessNamein interfaceAttachmentProperties- Returns:
- Custom process name sent to Firebird on attach;
nullmeans the default is applied (read from system propertyorg.firebirdsql.jdbc.processName)
-
setProcessName
Description copied from interface:AttachmentPropertiesSets a custom process name to send to Firebird on attach- Specified by:
setProcessNamein interfaceAttachmentProperties- Parameters:
processName- The process name to send;nullto apply the default behaviour (seeAttachmentProperties.getProcessName())
-
getSocketBufferSize
public int getSocketBufferSize()Description copied from interface:AttachmentPropertiesGet the socket buffer size.- Specified by:
getSocketBufferSizein interfaceAttachmentProperties- Returns:
- socket buffer size in bytes, or
-1if not set
-
setSocketBufferSize
public void setSocketBufferSize(int socketBufferSize) Description copied from interface:AttachmentPropertiesSet the socket buffer size.- Specified by:
setSocketBufferSizein interfaceAttachmentProperties- Parameters:
socketBufferSize- socket buffer size in bytes.
-
getSoTimeout
public int getSoTimeout()Description copied from interface:AttachmentPropertiesGet the initial Socket blocking timeout (SoTimeout).- Specified by:
getSoTimeoutin interfaceAttachmentProperties- Returns:
- The initial socket blocking timeout in milliseconds (0 is 'infinite'), or
-1if not set
-
setSoTimeout
public void setSoTimeout(int soTimeout) Description copied from interface:AttachmentPropertiesSet the initial Socket blocking timeout (SoTimeout).- Specified by:
setSoTimeoutin interfaceAttachmentProperties- Parameters:
soTimeout- Timeout in milliseconds (0 is 'infinite')
-
getConnectTimeout
public int getConnectTimeout()Description copied from interface:AttachmentPropertiesGet the connect timeout in seconds.- Specified by:
getConnectTimeoutin interfaceAttachmentProperties- Returns:
- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout), or
-1if not set
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Description copied from interface:AttachmentPropertiesSet the connect timeout in seconds.- Specified by:
setConnectTimeoutin interfaceAttachmentProperties- Parameters:
connectTimeout- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)
-
getLoginTimeout
This property is an alias for the connectTimeout property.
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Throws:
SQLException
-
setLoginTimeout
This property is an alias for the connectTimeout property.
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Throws:
SQLException
-
getWireCrypt
Description copied from interface:AttachmentPropertiesGet the wire encryption level.- Specified by:
getWireCryptin interfaceAttachmentProperties- Returns:
- Wire encryption level
-
setWireCrypt
Description copied from interface:AttachmentPropertiesSet the wire encryption level.Values are defined by
WireCrypt, values are handled case insensitive. Invalid values will throw an exception.- Specified by:
setWireCryptin interfaceAttachmentProperties- Parameters:
wireCrypt- Wire encryption level (nullnot allowed)
-
getDbCryptConfig
Description copied from interface:AttachmentPropertiesGet the database encryption plugin configuration.- Specified by:
getDbCryptConfigin interfaceAttachmentProperties- Returns:
- Database encryption plugin configuration, meaning plugin specific
-
setDbCryptConfig
Description copied from interface:AttachmentPropertiesSets the database encryption plugin configuration.- Specified by:
setDbCryptConfigin interfaceAttachmentProperties- Parameters:
dbCryptConfig- Database encryption plugin configuration, meaning plugin specific
-
getAuthPlugins
Description copied from interface:AttachmentPropertiesGet the list of authentication plugins to try.- Specified by:
getAuthPluginsin interfaceAttachmentProperties- Returns:
- comma-separated list of authentication plugins
-
setAuthPlugins
Description copied from interface:AttachmentPropertiesSets the authentication plugins to try.Invalid names are skipped during authentication.
- Specified by:
setAuthPluginsin interfaceAttachmentProperties- Parameters:
authPlugins- comma-separated list of authentication plugins
-
isWireCompression
public boolean isWireCompression()Description copied from interface:AttachmentPropertiesGet 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.confread by the client library will be used.- Specified by:
isWireCompressionin interfaceAttachmentProperties- Returns:
truewire compression enabled
-
setWireCompression
public void setWireCompression(boolean wireCompression) Description copied from interface:AttachmentPropertiesSets if the connection should try to enable wire compression.- Specified by:
setWireCompressionin interfaceAttachmentProperties- Parameters:
wireCompression-trueenable wire compression,falsedisable wire compression (the default)- See Also:
-
getEnableProtocol
Description copied from interface:AttachmentPropertiesComma-separated list of additionally enabled protocols.By default, pure Java connections of Jaybird only supports the protocol versions of supported Firebird versions. This property lists the additionally enabled unsupported protocol versions. If Jaybird does not have a listed protocol, it is silently ignored.
This property is ignored for native connections.
- Specified by:
getEnableProtocolin interfaceAttachmentProperties- Returns:
- List of unsupported protocol versions to try in addition to the supported protocols. Comma-separated
using only the version number (e.g.
"10,11"). Both the unmasked and masked version are supported (e.g.32780for protocol12), but we recommend to use the unmasked version. The value"*"will try all available protocols.
-
setEnableProtocol
Description copied from interface:AttachmentPropertiesComma-separated list of additionally enabled protocols.- Specified by:
setEnableProtocolin interfaceAttachmentProperties- Parameters:
enableProtocol- List of unsupported protocol versions to try in addition to the supported protocols.- See Also:
-
getSqlDialect
public int getSqlDialect()- Specified by:
getSqlDialectin interfaceDatabaseConnectionProperties- Returns:
- SQL dialect of the client connection
-
setSqlDialect
public void setSqlDialect(int sqlDialect) - Specified by:
setSqlDialectin interfaceDatabaseConnectionProperties- Parameters:
sqlDialect- SQL dialect of the client connection.
-
getPageCacheSize
public int getPageCacheSize()Description copied from interface:DatabaseConnectionPropertiesGet the page cache size.A value of
0indicates 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
0if the value hasn't been set yet.- Specified by:
getPageCacheSizein interfaceDatabaseConnectionProperties- Returns:
- size of cache in pages for this connection, can be specified for Classic and SuperClassic instances, ignored for SuperServer as the cache is shared; 0 when not set
-
setPageCacheSize
public void setPageCacheSize(int pageCacheSize) Description copied from interface:DatabaseConnectionPropertiesSet the page cache size.A value of
0indicates 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).
- Specified by:
setPageCacheSizein interfaceDatabaseConnectionProperties- Parameters:
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.
-
getDataTypeBind
Description copied from interface:DatabaseConnectionPropertiesGet thedataTypeBindconfiguration.- Specified by:
getDataTypeBindin interfaceDatabaseConnectionProperties- Returns:
- configuration value for
dataTypeBind, ornullfor driver default
-
setDataTypeBind
Description copied from interface:DatabaseConnectionPropertiesSets thedataTypeBindconfiguration.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 BINDstatements with the values.See also Firebird documentation for
SET BIND.- Specified by:
setDataTypeBindin interfaceDatabaseConnectionProperties- Parameters:
dataTypeBind- Firebird 4+ data type bind configuration, a semicolon-separated list of<from-type> TO <to-type>
-
getSessionTimeZone
Description copied from interface:DatabaseConnectionPropertiesGet thesessionTimeZone.- Specified by:
getSessionTimeZonein interfaceDatabaseConnectionProperties- Returns:
- value for
sessionTimeZone, ornullfor driver default (JVM default time zone)
-
setSessionTimeZone
Description copied from interface:DatabaseConnectionPropertiesSets thesessionTimeZone.- Specified by:
setSessionTimeZonein interfaceDatabaseConnectionProperties- 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). For offset-based names, the value will be normalized to the Firebird name (e.g. GMT+05:00 is stored as +05:00).
-
getBlobBufferSize
public int getBlobBufferSize()- Specified by:
getBlobBufferSizein interfaceDatabaseConnectionProperties- Returns:
- BLOB buffer size in bytes; if the configured value is less than an implementation-specific minimum, that minimum is returned
-
setBlobBufferSize
public void setBlobBufferSize(int blobBufferSize) - Specified by:
setBlobBufferSizein interfaceDatabaseConnectionProperties- Parameters:
blobBufferSize- size of the BLOB buffer in bytes
-
isUseStreamBlobs
public boolean isUseStreamBlobs()- Specified by:
isUseStreamBlobsin interfaceDatabaseConnectionProperties- Returns:
trueif stream blobs should be created, otherwisefalse.
-
setUseStreamBlobs
public void setUseStreamBlobs(boolean useStreamBlobs) - Specified by:
setUseStreamBlobsin interfaceDatabaseConnectionProperties- Parameters:
useStreamBlobs-trueif stream blobs should be created, otherwisefalse.
-
isDefaultResultSetHoldable
public boolean isDefaultResultSetHoldable()Description copied from interface:DatabaseConnectionPropertiesGet whether ResultSets are holdable by default.- Specified by:
isDefaultResultSetHoldablein interfaceDatabaseConnectionProperties- Returns:
trueResultSets by default areResultSet.HOLD_CURSORS_OVER_COMMIT,false(default), ResultSets areResultSet.CLOSE_CURSORS_AT_COMMIT
-
setDefaultResultSetHoldable
public void setDefaultResultSetHoldable(boolean defaultResultSetHoldable) Description copied from interface:DatabaseConnectionPropertiesSet ifResultSetshould beResultSet.HOLD_CURSORS_OVER_COMMITby default.- Specified by:
setDefaultResultSetHoldablein interfaceDatabaseConnectionProperties- Parameters:
defaultResultSetHoldable-trueResultSets are holdable,false(default) ResultSets areResultSet.CLOSE_CURSORS_AT_COMMIT
-
isUseFirebirdAutocommit
public boolean isUseFirebirdAutocommit()Description copied from interface:DatabaseConnectionPropertiesGet whether to use Firebird autocommit (experimental).- Specified by:
isUseFirebirdAutocommitin interfaceDatabaseConnectionProperties- Returns:
trueuse Firebird autocommit
-
setUseFirebirdAutocommit
public void setUseFirebirdAutocommit(boolean useFirebirdAutocommit) Description copied from interface:DatabaseConnectionPropertiesSet whether to use Firebird autocommit (experimental).- Specified by:
setUseFirebirdAutocommitin interfaceDatabaseConnectionProperties- Parameters:
useFirebirdAutocommit-trueUse Firebird autocommit
-
isColumnLabelForName
public boolean isColumnLabelForName()Description copied from interface:DatabaseConnectionPropertiesGets the current setting ofcolumnLabelForName- Specified by:
isColumnLabelForNamein interfaceDatabaseConnectionProperties- Returns:
falseJDBC compliant behavior (columnNameis returned),truecompatibility option (columnLabelis returned)- See Also:
-
setColumnLabelForName
public void setColumnLabelForName(boolean columnLabelForName) Description copied from interface:DatabaseConnectionPropertiesSet ifResultSetMetaData.getColumnName(int)returns thecolumnLabelinstead of thecolumnName.The default behaviour (with
columnLabelForName=falseis JDBC-compliant. The behavior for valuetrueis to provide compatibility with tools with a wrong expectation.- Specified by:
setColumnLabelForNamein interfaceDatabaseConnectionProperties- Parameters:
columnLabelForName-falseJDBC compliant behavior (columnNameis returned),truecompatibility option (columnLabelis returned)
-
getGeneratedKeysEnabled
Description copied from interface:DatabaseConnectionPropertiesGet thegeneratedKeysEnabledconfiguration.- Specified by:
getGeneratedKeysEnabledin interfaceDatabaseConnectionProperties- Returns:
- configuration value for
generatedKeysEnabled, ornullfor driver default
-
setGeneratedKeysEnabled
Description copied from interface:DatabaseConnectionPropertiesSets thegeneratedKeysEnabledconfiguration.- Specified by:
setGeneratedKeysEnabledin interfaceDatabaseConnectionProperties- 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)
-
isIgnoreProcedureType
public boolean isIgnoreProcedureType()Description copied from interface:DatabaseConnectionPropertiesGet the value forignoreProcedureType.- Specified by:
isIgnoreProcedureTypein interfaceDatabaseConnectionProperties- Returns:
- value for
ignoreProcedureType
-
setIgnoreProcedureType
public void setIgnoreProcedureType(boolean ignoreProcedureType) Description copied from interface:DatabaseConnectionPropertiesSets the valueignoreProcedureType.When set to true, the
CallableStatementimplementation 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:
setIgnoreProcedureTypein interfaceDatabaseConnectionProperties- Parameters:
ignoreProcedureType-trueIgnore procedure type
-
getDecfloatRound
- Specified by:
getDecfloatRoundin interfaceDatabaseConnectionProperties- Returns:
- the server-side
DECFLOATrounding mode,nullapplies the Firebird server default
-
setDecfloatRound
Description copied from interface:DatabaseConnectionPropertiesSets theDECFLOATrounding mode- Specified by:
setDecfloatRoundin interfaceDatabaseConnectionProperties- Parameters:
decfloatRound- Firebird 4+ server-sideDECFLOATrounding mode (ceiling, up, half_up, half_even, half_down, down, floor, reround);nullto apply the Firebird server default (half_upin Firebird 4)
-
getDecfloatTraps
- Specified by:
getDecfloatTrapsin interfaceDatabaseConnectionProperties- Returns:
- the server-side
DECFLOATerror traps,nullapplies the Firebird server default
-
setDecfloatTraps
Description copied from interface:DatabaseConnectionPropertiesSets theDECFLOATerror traps.- Specified by:
setDecfloatTrapsin interfaceDatabaseConnectionProperties- Parameters:
decfloatTraps- Firebird 4+ server-sideDECFLOATerror traps; comma-separated list with optionsDivision_by_zero, Inexact, Invalid_operation, Overflow, Underflow;nullto apply Firebird server default (Division_by_zero,Invalid_operation,Overflowin Firebird 4)
-
getTpbMapping
Description copied from interface:DatabaseConnectionPropertiesGet the used TPB mapping.- Specified by:
getTpbMappingin interfaceDatabaseConnectionProperties- Returns:
- resource bundle name of the TPB mapping
- See Also:
-
setTpbMapping
Description copied from interface:DatabaseConnectionPropertiesSets a resource bundle name with the TPB mapping.For compatibility reasons, the prefix
"res:"is allowed, but this works exactly the same as without a prefix. We strongly recommend not to use the"res:"prefix, future versions of Jaybird (Jaybird 7 or later) may stop supporting this.The resource bundle should contain a mapping between the transaction isolation level (name of the constant in the
Connectioninterface and a comma-separated list of TPB parameters).- Specified by:
setTpbMappingin interfaceDatabaseConnectionProperties- Parameters:
tpbMapping- name of the resource bundle
-
getDefaultTransactionIsolation
public int getDefaultTransactionIsolation()Description copied from interface:DatabaseConnectionPropertiesGet the default transaction isolation level. This is the transaction isolation level for the newly created connections.- Specified by:
getDefaultTransactionIsolationin interfaceDatabaseConnectionProperties- Returns:
- default transaction isolation level.
-
setDefaultTransactionIsolation
public void setDefaultTransactionIsolation(int defaultIsolationLevel) Description copied from interface:DatabaseConnectionPropertiesSet the default transaction isolation level.- Specified by:
setDefaultTransactionIsolationin interfaceDatabaseConnectionProperties- Parameters:
defaultIsolationLevel- default transaction isolation level.
-
getDefaultIsolation
Description copied from interface:DatabaseConnectionPropertiesGet the default transaction isolation level as string. This method is complementary toDatabaseConnectionProperties.getDefaultTransactionIsolation(), however it returns a string name instead of a numeric constant.- Specified by:
getDefaultIsolationin interfaceDatabaseConnectionProperties- Returns:
- default transaction isolation as string.
- See Also:
-
setDefaultIsolation
Description copied from interface:DatabaseConnectionPropertiesSet the default transaction isolation level as string. This method is complementary toDatabaseConnectionProperties.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.- Integer string values matching the isolation levels
- Specified by:
setDefaultIsolationin interfaceDatabaseConnectionProperties- Parameters:
isolation- string constant representing a default isolation level.
-
getScrollableCursor
- Specified by:
getScrollableCursorin interfaceDatabaseConnectionProperties- Returns:
- Configuration of scrollable cursors, either
EMULATED(default) orSERVER(case-insensitive) - See Also:
-
setScrollableCursor
Description copied from interface:DatabaseConnectionPropertiesSets the type of scrollable cursor.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 toEMULATEDbehaviour when server-side support is not available, or when holdable cursors are requested
- Specified by:
setScrollableCursorin interfaceDatabaseConnectionProperties- Parameters:
scrollableCursor- Scrollable cursor type, one ofEMULATEDorSERVER(case-insensitive)
-
isUseServerBatch
public boolean isUseServerBatch()- Specified by:
isUseServerBatchin interfaceDatabaseConnectionProperties- Returns:
true(default) use server-side batch if supported by server,falsealways use emulated batch- See Also:
-
setUseServerBatch
public void setUseServerBatch(boolean useServerBatch) Description copied from interface:DatabaseConnectionPropertiesSets whether to use server-side batch support, if available.Currently, server-side batch is only supported with Firebird 4.0 or higher, with a pure Java connection, using a
PreparedStatement, but not aCallableStatement, 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).
- Specified by:
setUseServerBatchin interfaceDatabaseConnectionProperties- Parameters:
useServerBatch-true, use server-side batch support if possible,falsealways use emulated batch
-
getServerBatchBufferSize
public int getServerBatchBufferSize()- Specified by:
getServerBatchBufferSizein interfaceDatabaseConnectionProperties- Returns:
- batch buffer size in bytes,
< 0to 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 maximum - See Also:
-
setServerBatchBufferSize
public void setServerBatchBufferSize(int serverBatchBufferSize) Description copied from interface:DatabaseConnectionPropertiesSets the server batch buffer size (if server batch is supported and enabled).- Specified by:
setServerBatchBufferSizein interfaceDatabaseConnectionProperties- Parameters:
serverBatchBufferSize- server batch buffer size in bytes, use< 0to set server-side default (16MB as of Firebird 4.0), use0to use server-side maximum (256MB as of Firebird 4.0), values exceeding server-side maximum will set server-side maximum
-
getParallelWorkers
public int getParallelWorkers()- Specified by:
getParallelWorkersin interfaceAttachmentProperties- Returns:
- number of parallel workers,
-1means no value was set (or it was explicitly set to-1)
-
setParallelWorkers
public void setParallelWorkers(int parallelWorkers) Description copied from interface:AttachmentPropertiesSets the number of parallel workers of the connection.Requires Firebird 5.0 or higher, and a Firebird server configured with
MaxParallelWorkershigher than specified byparallelWorkers.NOTE: For service attachments, this property controls behaviour only for specific operations, and requires Jaybird to explicitly set the parallel workers for that operation.
- Specified by:
setParallelWorkersin interfaceAttachmentProperties- Parameters:
parallelWorkers- number of parallel workers
-
getSocketFactory
Description copied from interface:AttachmentPropertiesThe class name of a custom socket factory to be used for pure Java connections.- Specified by:
getSocketFactoryin interfaceAttachmentProperties- Returns:
- fully-qualified class name of a
SocketFactoryimplementation, or (default)nullfor the default socket factory - See Also:
-
setSocketFactory
Description copied from interface:AttachmentPropertiesSets the class name of a custom socket factory to be used for pure Java connections.The class must extend
SocketFactoryand have a public single-arg constructor accepting aProperties, or a public no-arg constructor. ThePropertiesobject passed in the first case contains custom connection properties with the suffix@socketFactory, and — possibly — other selected properties.- Specified by:
setSocketFactoryin interfaceAttachmentProperties- Parameters:
socketFactory- fully-qualified class name of aSocketFactoryimplementation, ornullfor the default socket factory
-
isUseCatalogAsPackage
public boolean isUseCatalogAsPackage()- Specified by:
isUseCatalogAsPackagein interfaceDatabaseConnectionProperties- Returns:
truedatabase metadata uses catalogs to report packages,false(default) no catalogs, and packages and their procedures and functions are not accessible- See Also:
-
setUseCatalogAsPackage
public void setUseCatalogAsPackage(boolean useCatalogAsPackage) Description copied from interface:DatabaseConnectionPropertiesSets whether to use catalogs to report packages in database metadata.When set to
true, database metadata will return the names of packages fromDatabaseMetaData.getCatalogs(), andDatabaseMetaData.getFunctions(String, String, String),DatabaseMetaData.getFunctionColumns(String, String, String, String),DatabaseMetaData.getProcedures(String, String, String), andDatabaseMetaData.getProcedureColumns(String, String, String, String)will include information on packaged procedures and functions.The behaviour of the input parameter
catalogof these methods is modified compared to the default behaviour:null: both packaged and top-level procedures/functions are searched""(empty string): only top-level procedures/functions are searched- non-empty string: only procedures/functions in the named package are searched (NOTE: exact match, case-sensitive)
The returned result set is modified compared to the default behaviour:
PROCEDURE_CAT/FUNCTION_CAT: for top-level procedures/functions, its value is""(empty string) — notnull— to account for behaviour of parameterpackagewhen searching metadataSPECIFIC_NAME: for packaged procedures/functions will report<quoted-package-name>.<quoted-routine-name>
Return values of other metadata methods are changed to match:
DatabaseMetaData.getCatalogSeparator(),DatabaseMetaData.getCatalogTerm(),DatabaseMetaData.isCatalogAtStart(),DatabaseMetaData.getMaxCatalogNameLength(),DatabaseMetaData.supportsCatalogsInDataManipulation(),DatabaseMetaData.supportsCatalogsInProcedureCalls()- Specified by:
setUseCatalogAsPackagein interfaceDatabaseConnectionProperties- Parameters:
useCatalogAsPackage-truedatabase metadata uses catalogs to report packages,false(default) no catalogs, and packages and their procedures and functions are not accessible
-
isAllowTxStmts
public boolean isAllowTxStmts()- Specified by:
isAllowTxStmtsin interfaceDatabaseConnectionProperties- Returns:
trueif execution ofCOMMIT [WORK],ROLLBACK [WORK]orSET TRANSACTION [..]is allowed,false(default) to throw an exception when attempting to execute or prepare such statements- See Also:
-
setAllowTxStmts
public void setAllowTxStmts(boolean allowTxStmts) Description copied from interface:DatabaseConnectionPropertiesSets whether transaction management statements with (hard) transaction boundaries are allowed to be prepared or executed.Setting to
truewill enable Jaybird to execute equivalent operations through the JDBC API (specifically,Statement.execute(String),Statement.executeUpdate(String),Statement.executeLargeUpdate(String)and siblings, and statements prepared withConnection.prepareStatement(String)and siblings. Using callable statements (e.g. usingConnection.prepareCall(String)),Statement.executeQuery(String), or batch execution is never supported.The implementation is free to execute the provided statement text or use an equivalent operation that has the same effect.
Setting this configuration to
trueonly affects the JDBC API, and has no effect on direct use of the GDS-ng API.- Specified by:
setAllowTxStmtsin interfaceDatabaseConnectionProperties- Parameters:
allowTxStmts-trueto allow execution ofCOMMIT [WORK],ROLLBACK [WORK]orSET TRANSACTION [..],false(default) to throw an exception when attempting to execute or prepare such statements
-
isExtendedMetadata
public boolean isExtendedMetadata()- Specified by:
isExtendedMetadatain interfaceDatabaseConnectionProperties- Returns:
true(default) if metadata (e.g.ResultSetMetaData) will perform additional queries for more detailed information,falseif only the available bind information will be used- See Also:
-
setExtendedMetadata
public void setExtendedMetadata(boolean extendedMetadata) Description copied from interface:DatabaseConnectionPropertiesSets if certain metadata classes will perform additional queries to enrich the information for certain types.Currently this is used only by
ResultSetMetaDatafor itsgetPrecisionandisAutoIncrementmethods. If disabled, these methods will return an estimated precision, orfalsefor 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.
- Specified by:
setExtendedMetadatain interfaceDatabaseConnectionProperties- Parameters:
extendedMetadata-true(default) - metadata (e.g.ResultSetMetaData) will perform additional queries for more detailed information,false- only the available bind information will be used
-
isCreateDatabaseIfNotExist
public boolean isCreateDatabaseIfNotExist()- Specified by:
isCreateDatabaseIfNotExistin interfaceDatabaseConnectionProperties- Returns:
false(default) if failure to connect does nothing,trueif some classes of connection failures will result in an attempt to create the database- See Also:
-
setCreateDatabaseIfNotExist
public void setCreateDatabaseIfNotExist(boolean createDatabaseIfNotExist) Description copied from interface:DatabaseConnectionPropertiesSets if an attempt should be made to create a database if it does not exist.If the connection fails because the database cannot be opened, Jaybird will attempt to create the database. Additional or overridden properties can be set using
BaseProperties.setProperty(String, String)by suffixing the property name with@create.As Firebird does not clearly report that a database does not exist (e.g. it may exist, but not be accessible to the server, etc.), and the errors may be OS-specific, the attempt to create may fail. Jaybird may try to use some heuristics to avoid creation for some errors, but this is an implementation details which may change in point releases.
- Specified by:
setCreateDatabaseIfNotExistin interfaceDatabaseConnectionProperties- Parameters:
createDatabaseIfNotExist-false(default) if failure to connect does nothing,trueif some classes of connection failures will result in an attempt to create the database
-
getReportSQLWarnings
- Specified by:
getReportSQLWarningsin interfaceDatabaseConnectionProperties- Returns:
ALL(default) ifSQLWarningshould be reported byConnection,StatementandResultSet,NONEifSQLWarningshould not be reported- See Also:
-
setReportSQLWarnings
Description copied from interface:DatabaseConnectionPropertiesSets ifSQLWarningshould be reported byConnection.getWarnings(),Statement.getWarnings(), andResultSet.getWarnings().Allowed values (case-insensitive):
- ALL — (default) report all
SQLWarning - NONE — report no
SQLWarning; this behaviour is not JDBC-compliant
The default value can be overridden by setting system property
org.firebirdsql.jdbc.defaultReportSQLWarnings.- Specified by:
setReportSQLWarningsin interfaceDatabaseConnectionProperties- Parameters:
reportSQLWarnings-ALL(default) ifSQLWarningshould be reported byConnection,StatementandResultSet,NONEifSQLWarningshould not be reported; settingnullwill useALL
- ALL — (default) report all
-
isAsyncFetch
public boolean isAsyncFetch()Description copied from interface:DatabaseConnectionPropertiesGets if async fetching is enabled or disabled (pure Java only).This property may get removed in Jaybird 7 or later, once this async fetching has proven itself.
- Specified by:
isAsyncFetchin interfaceDatabaseConnectionProperties- Returns:
true(default) async fetching is enabled,falseasync fetching is disabled- See Also:
-
setAsyncFetch
public void setAsyncFetch(boolean asyncFetch) Description copied from interface:DatabaseConnectionPropertiesSets if async fetching is enabled or disabled (pure Java only).The default value can be overridden by setting system property
org.firebirdsql.jdbc.defaultAsyncFetch.This property may get removed in Jaybird 7 or later, once this async fetching has proven itself.
- Specified by:
setAsyncFetchin interfaceDatabaseConnectionProperties- Parameters:
asyncFetch-true(default) async fetching is enabled,falseasync fetching is disabled
-
getUserName
Deprecated.- Specified by:
getUserNamein interfaceFirebirdConnectionProperties- Returns:
- name of the user that will be used when connecting to the database.
-
setUserName
Deprecated.- Specified by:
setUserNamein interfaceFirebirdConnectionProperties- Parameters:
userName- name of the user that will be used when connecting to the database.
-