Class FirebirdSupportInfo
- java.lang.Object
-
- org.firebirdsql.util.FirebirdSupportInfo
-
public final class FirebirdSupportInfo extends java.lang.ObjectHelper class that reports if a Firebird version supports a specific feature.Intended as a repository for Jaybird to check for functionality support, or tests to check their assumptions, or decide on test or application behavior based on functionality support.
Primary reason for existence of this class is to support version dependent functionality in Jaybird or version dependent tests in the Jaybird test suite, so feature checks are only added when they are necessary for Jaybird or the test suite. That said: if you miss feature checks, don't hesitate to create an issue in the Jaybird tracker.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
-
Method Summary
-
-
-
Method Detail
-
isVersionEqualOrAbove
public boolean isVersionEqualOrAbove(int majorVersion, int minorVersion)Check if the major.minor of this version is equal to or larger than the specified version.- Parameters:
majorVersion- Major versionminorVersion- Minor version- Returns:
truewhen current major is larger than required, or major is same and minor is equal to or larger than required
-
isVersionEqualOrAbove
public boolean isVersionEqualOrAbove(int requiredMajorVersion, int requiredMinorVersion, int requiredVariant)Check if the major.minor.variant of this version is equal to or larger than the specified required version.- Parameters:
requiredMajorVersion- Required major versionrequiredMinorVersion- Required minor versionrequiredVariant- Required variant version- Returns:
truewhen current major is larger than required, or major is same and minor is equal to required and variant equal to or larger than required, or major is same and minor is larger than required
-
isVersionBelow
public boolean isVersionBelow(int majorVersion, int minorVersion)Check if the major.minor of this version is below the specified version.Equivalent to
!isVersionEqualOrAbove(majorVersion, minorVersion).- Parameters:
majorVersion- Major versionminorVersion- Minor version- Returns:
truewhen current major is smaller than the specified major, or major is same and minor is smaller than the specified minor
-
supportsBigint
public boolean supportsBigint()
Checks if BIGINT is supported.Low level this feature was added in Interbase 6.0 / Firebird 1.0, but it was never surfaced in DDL
- Returns:
truewhen the data type BIGINT is supported
-
supportsBoolean
public boolean supportsBoolean()
- Returns:
truewhen the data type BOOLEAN is supported
-
supportsDecfloat
public boolean supportsDecfloat()
- Returns:
truewhen the data type DECFLOAT is supported
-
supportsDecimalPrecision
public boolean supportsDecimalPrecision(int precision)
Support for decimal (and numeric) precision.- Parameters:
precision- Precision- Returns:
truewhen DECIMAL (and NUMERIC) support the supplied precision; 0 or negative precision always returnfalse
-
maxDecimalPrecision
public int maxDecimalPrecision()
- Returns:
- The maximum decimal and numeric precision
-
supportsInt128
public boolean supportsInt128()
- Returns:
truewhen the data type INT128 is supported
-
supportsComment
public boolean supportsComment()
- Returns:
truewhen the COMMENT statement is supported
-
supportsGetSetContext
public boolean supportsGetSetContext()
- Returns:
truewhen RDB$GET_CONTEXT and RDB$SET_CONTEXT are supported
-
supportsCase
public boolean supportsCase()
- Returns:
truewhen CASE (simple or searched) is supported
-
reportsBlobCharSetInDescriptor
public boolean reportsBlobCharSetInDescriptor()
- Returns:
truewhen the blob character set is reported in the scale of the field descriptor
-
reportsByteLengthInDescriptor
public boolean reportsByteLengthInDescriptor()
TODO: Check if this is for all types or only for metadata.- Returns:
truewhen the length of the field descriptor reports the byte length (max byte per char * char length)
-
supportsInsertReturning
public boolean supportsInsertReturning()
TODO: Add methods for other RETURNING types?- Returns:
truewhen INSERT ... RETURNING ... is supported
-
supportsUpdateReturning
public boolean supportsUpdateReturning()
- Returns:
truewhen UPDATE ... RETURNING ... is supported
-
supportsReturningAll
public boolean supportsReturningAll()
- Returns:
truewhenRETURNING *andRETURNING ref.*is supported.
-
supportsMultiRowReturning
public boolean supportsMultiRowReturning()
- Returns:
truewhenRETURNINGsupports multiple rows,falseonly singleton results
-
supportsUtf8
public boolean supportsUtf8()
- Returns:
truewhen the server knows the UTF8 character set (NOTE: For firebird 1.5 it is an alias for UNICODE_FSS)
-
supportsSavepoint
public boolean supportsSavepoint()
- Returns:
truewhen SAVEPOINT is supported
-
supportsExecuteBlock
public boolean supportsExecuteBlock()
- Returns:
truewhen EXECUTE BLOCK is supported
-
supportsSqlUserManagement
public boolean supportsSqlUserManagement()
- Returns:
truewhen CREATE/ALTER/DROP USER is supported
-
supportsCancelOperation
public boolean supportsCancelOperation()
- Returns:
truewhen fb_cancel_operation is supported
-
supportsTableAlias
public boolean supportsTableAlias()
- Returns:
truewhen field descriptors contain table alias information
-
supportsNullDataType
public boolean supportsNullDataType()
- Returns:
truewhen theNULLdata type and? IS NULLis supported
-
supportsUserAndGroupIdInUser
public boolean supportsUserAndGroupIdInUser()
- Returns:
truewhenisc_spb_sec_useridandisc_spb_sec_groupidare supported.
-
supportsProtocol
public boolean supportsProtocol(int protocolVersion)
Checks support for protocol versions. The check is limited to those protocol versions supported by Jaybird (10-16 and 18 at this time, although v14 is only implemented as part of v15).- Parameters:
protocolVersion- Protocol version number- Returns:
truewhen the database supports the specified protocol
-
supportsCustomExceptionMessages
public boolean supportsCustomExceptionMessages()
- Returns:
truewhen custom exception messages are supported.
-
supportsParametrizedExceptions
public boolean supportsParametrizedExceptions()
- Returns:
truewhen parametrized exceptions are supported.
-
supportsMonitoringTables
public boolean supportsMonitoringTables()
- Returns:
truewhen monitoring tables are supported.
-
supportsGlobalTemporaryTables
public boolean supportsGlobalTemporaryTables()
- Returns:
truewhen global temporary tables (GTTs) are supported.
-
supportsFullSearchableBlobs
public boolean supportsFullSearchableBlobs()
- Returns:
truewhen blobs are fully searchable (e.g. using `LIKE`).
-
supportsIdentityColumns
public boolean supportsIdentityColumns()
- Returns:
truewhen identity columns are supported.
-
maxIdentifierLengthCharacters
public int maxIdentifierLengthCharacters()
- Returns:
- The maximum number of characters in an identifier.
-
maxIdentifierLengthBytes
public int maxIdentifierLengthBytes()
- Returns:
- The maximum number of bytes in an identifier.
- See Also:
maxReportedIdentifierLengthBytes()
-
maxReportedIdentifierLengthBytes
public int maxReportedIdentifierLengthBytes()
- Returns:
- The maximum number of bytes reported in parameter metadata for an identifier
- See Also:
maxIdentifierLengthBytes()
-
reportedMetadataCharacterSetId
public int reportedMetadataCharacterSetId()
- Returns:
- The character set id of system metadata
-
supportsPageSize
public boolean supportsPageSize(int pageSize)
-
supportsWireEncryption
public boolean supportsWireEncryption()
-
supportsWireCryptArc4
public boolean supportsWireCryptArc4()
-
supportsWireCryptChaCha
public boolean supportsWireCryptChaCha()
-
supportsWireCompression
public boolean supportsWireCompression()
- Returns:
truewhen zlib wire compression is supported
-
supportsNativeUserDefinedFunctions
public boolean supportsNativeUserDefinedFunctions()
- Returns:
truewhen UDFs (User Defined Functions) - backed by a native library - are supported
-
supportsPsqlFunctions
public boolean supportsPsqlFunctions()
- Returns:
truewhen PSQL functions are supported
-
supportsAuthenticationPlugin
public boolean supportsAuthenticationPlugin(java.lang.String pluginName)
Checks whether the Firebird version supports a plugin name.Firebird version 2.5 and earlier are considered to support only
Legacy_Auth.NOTE: This method only checks if the specified plugin was shipped with a Firebird version, it does not check whether the plugin is enabled, nor if additional plugins are installed.
- Parameters:
pluginName- Authentication plugin name (case-sensitive)- Returns:
trueif supported,falseotherwise.
-
supportsRecordVersionPseudoColumn
public boolean supportsRecordVersionPseudoColumn()
- Returns:
truewhenRDB$RECORD_VERSIONpseudo column is supported
-
getSystemTableCount
public int getSystemTableCount()
The number of system tables (including monitoring tables).- Returns:
- Number of system tables, or
-1if the Firebird version is not known/supported.
-
supportsCaseSensitiveUserNames
public boolean supportsCaseSensitiveUserNames()
- Returns:
truewhen this Firebird version supports case-sensitive usernames.
-
supportsExplainedExecutionPlan
public boolean supportsExplainedExecutionPlan()
- Returns:
truewhen this Firebird version supports explained (detailed) execution plans.
-
supportsTimeZones
public boolean supportsTimeZones()
- Returns:
truewhen this Firebird version supportsTIME(STAMP) WITH TIME ZONE
-
supportsPackages
public boolean supportsPackages()
- Returns:
truewhen this Firebird version supports packages.
-
supportsFloatBinaryPrecision
public boolean supportsFloatBinaryPrecision()
- Returns:
truewhen this Firebird version supports FLOAT(p) with binary precision.
-
supportsStatementTimeouts
public boolean supportsStatementTimeouts()
- Returns:
truewhen this Firebird version supports statement timeouts.
-
supportsStatementUnprepare
public boolean supportsStatementUnprepare()
- Returns:
truewhen this Firebird version supports statement unprepare (DSQL_unprepare)
-
supportsNBackupWithGuid
public boolean supportsNBackupWithGuid()
- Returns:
truewhen this Firebird version supports NBackup backup with GUID
-
supportsNBackupInPlaceRestore
public boolean supportsNBackupInPlaceRestore()
- Returns:
truewhen this Firebird version supports NBackup in-place restore
-
supportsNBackupFixup
public boolean supportsNBackupFixup()
- Returns:
truewhen this Firebird version supports NBackup fixup
-
supportsNBackupPreserveSequence
public boolean supportsNBackupPreserveSequence()
- Returns:
truewhen this Firebird version supports NBackup preserve sequence
-
supportsNBackupCleanHistory
public boolean supportsNBackupCleanHistory()
- Returns:
truewhen this Firebird version supports NBackup clean history
-
supportsScrollableCursors
public boolean supportsScrollableCursors()
- Returns:
truewhen this Firebird version supports scrollable cursors. (NOTE: this does not mean the connection supports it, as that depends on the actual protocol (i.e. PURE_JAVA or derivative))
-
supportsServerBatch
public boolean supportsServerBatch()
- Returns:
truewhen this Firebird version supports server-side batch updates. (NOTE: this does not mean the connection supports it, as that depends on the actual protocol (i.e. PURE_JAVA or derivative))
-
supportsCustomSecurityDb
public boolean supportsCustomSecurityDb()
- Returns:
truewhen this Firebird version supports custom security databases
-
supportsWnet
public boolean supportsWnet()
-
supportsStatementTextLongerThan64K
public boolean supportsStatementTextLongerThan64K()
- Returns:
truewhen this Firebird version supports statement texts longer than 64KB
-
supportsParallelWorkers
public boolean supportsParallelWorkers()
- Returns:
truewhen this Firebird version supports parallel workers
-
supportsRDB$CONFIG
public boolean supportsRDB$CONFIG()
- Returns:
truewhen this Firebird version has theRDB$CONFIGtable
-
supportsUpgradeOds
public boolean supportsUpgradeOds()
- Returns:
trueif the gfix/service repair option upgrade ODS is supported
-
supportsFixIcu
public boolean supportsFixIcu()
- Returns:
trueif the gfix/service repair option icu (fix ICU) is supported
-
supportsPartialIndices
public boolean supportsPartialIndices()
- Returns:
trueif partial indices are supported
-
hasProcedureTypeColumn
public boolean hasProcedureTypeColumn()
- Returns:
trueif the default ODS of this Firebird version has columnRDB$PROCEDURE_TYPE
-
isWindows
public boolean isWindows()
-
supportInfoFor
public static FirebirdSupportInfo supportInfoFor(GDSServerVersion serverVersion)
- Parameters:
serverVersion- Server version- Returns:
- FirebirdVersionSupport instance
-
supportInfoFor
public static FirebirdSupportInfo supportInfoFor(FbAttachment attachment)
- Parameters:
attachment- Low level attachment object- Returns:
- FirebirdVersionSupport instance
-
supportInfoFor
public static FirebirdSupportInfo supportInfoFor(java.sql.Connection connection)
- Parameters:
connection- A database connection (NOTE:Connectionis used, but it must be or unwrap to aFirebirdConnection).- Returns:
- FirebirdVersionSupport instance
- Throws:
java.lang.IllegalArgumentException- When the provided connection is not an instance of or wrapper forFirebirdConnectionjava.lang.IllegalStateException- When an SQLException occurs unwrapping the connection, or creating theFirebirdSupportInfoinstance
-
-