├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── codeql.yml │ ├── reuse-compliance.yml │ └── run-tests.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CONTRIBUTING.md ├── LICENSE ├── LICENSES ├── Apache-2.0.txt ├── BSD-3-Clause.txt ├── CC0-1.0.txt ├── LGPL-2.1-or-later.txt ├── LicenseRef-ICLA.txt ├── LicenseRef-PDL-1.0.txt ├── MIT.txt ├── OFL-1.1.txt └── UnixCrypt.txt ├── README.md ├── REUSE.toml ├── SECURITY.md ├── build-properties.gradle ├── build.gradle ├── build.properties ├── chacha64-plugin ├── build.gradle └── src │ ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── firebirdsql │ │ │ └── jaybird │ │ │ └── chacha64 │ │ │ ├── ChaCha64EncryptionPlugin.java │ │ │ └── ChaCha64EncryptionPluginSpi.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.firebirdsql.gds.ng.wire.crypt.EncryptionPluginSpi │ └── test │ └── java │ └── org │ └── firebirdsql │ └── jaybird │ └── chacha64 │ └── ChaCha64EncryptionPluginSpiTest.java ├── devdoc ├── build-documentation.md ├── formatting │ ├── eclipse-jaybird-formatter.xml │ └── intellij-jaybird-formatter.xml ├── install-pre-commit-hooks.md ├── jaybird-icla.txt ├── jdp │ ├── jdp-2019-01-jaybird-design-proposal.md │ ├── jdp-2019-02-version-number-and-naming-scheme.md │ ├── jdp-2019-03-time-zone-support.md │ ├── jdp-2019-04-version-number-and-naming-scheme.md │ ├── jdp-2019-05-database-metadata-implementation.md │ ├── jdp-2019-06-ability-to-monitor-driver-operations.md │ ├── jdp-2020-01-extended-time-zone-types-support.md │ ├── jdp-2020-02-drop-java-7-support.md │ ├── jdp-2020-03-remove-jca-support.md │ ├── jdp-2020-04-migrate-to-gradle.md │ ├── jdp-2020-05-firebird-embedded-locator-service-provider.md │ ├── jdp-2020-06-offsettime-derivation-for-named-zone.md │ ├── jdp-2020-07-offset-conversion-for-named-session-zone.md │ ├── jdp-2020-08-int128-support.md │ ├── jdp-2020-09-add-zoneddatetime-support.md │ ├── jdp-2020-10-propagation-of-connection-properties.md │ ├── jdp-2021-01-unified-database-coordinates.md │ ├── jdp-2021-02-stream-blobs-by-default.md │ ├── jdp-2021-03-drop-firebird-2-5-support.md │ ├── jdp-2021-04-real-scrollable-cursor-support.md │ ├── jdp-2022-01-server-side-batch-support.md │ ├── jdp-2022-02-replace-synchronized-with-reentrantlock.md │ ├── jdp-2022-03-java-17-minimum-version.md │ ├── jdp-2022-04-deprecate-ooremote.md │ ├── jdp-2023-01-version-number-and-naming-scheme.md │ ├── jdp-2023-02-how-to-handle-new-java-features.md │ ├── jdp-2023-03-jaybird-style-guide.md │ ├── jdp-2023-04-disable-unsupported-protocols.md │ ├── jdp-2023-05-use-java-platform-logging-api.md │ ├── jdp-2023-06-chacha64-support.adoc │ ├── jdp-2023-07-native-plugin-as-separate-dependency.adoc │ ├── jdp-2023-09-use-catalog-as-package.adoc │ ├── jdp-2023-10-specify-native-library-as-connection-property.adoc │ ├── jdp-2023-11-new-design-client-info-properties.adoc │ ├── jdp-2023-12-async-fetching-result-set-rows.adoc │ ├── jdp-2023-13-modularization-of-jaybird.adoc │ ├── jdp-2024-01-explicit-support-for-transaction-statements.adoc │ ├── jdp-2024-02-create-database-through-jdbc-url.adoc │ ├── jdp-2024-03-do-not-close-result-set-after-last-row-in-auto-commit.adoc │ ├── jdp-2024-04-nullability-annotations.adoc │ ├── jdp-2024-05-behavior-of-updatable-result-sets.adoc │ ├── jdp-2024-06-change-handling-of-result-set-forward-only-with-hold-cursors-over-commit.adoc │ ├── jdp-2024-07-add-system-property-to-configure-default-enable-protocol.adoc │ ├── jdp-2024-08-optionally-disable-sql-warnings.adoc │ ├── jdp-2024-09-custom-socket-factory-for-pure-java-connections.adoc │ ├── jdp-2024-10-allow-disabling-async-fetch.adoc │ ├── jdp-2025-01-apply-spdx-license-info-and-comply-with-reuse-specification.adoc │ ├── jdp-2025-02-lazy-send-blob-optimizations.adoc │ ├── jdp-2025-03-implement-protocol-19.adoc │ ├── jdp-2025-04-lazy-send-blob-optimizations-info-items.adoc │ ├── jdp-2025-05-protocol-descriptor-inheritance.adoc │ └── work-in-progress │ │ └── wip-experimental-reimplementation-of-callable-statement.adoc ├── maven-release │ └── instructions.txt └── publish.md ├── doc-extension.groovy ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── internal-tools ├── build.gradle └── src │ └── main │ ├── java │ └── org │ │ └── firebirdsql │ │ └── internal │ │ └── tools │ │ ├── Facility.java │ │ ├── FirebirdError.java │ │ ├── FirebirdErrorStore.java │ │ ├── LangRefCsvStore.java │ │ ├── MessageConverter.java │ │ ├── MessageExtractor.java │ │ ├── MessageStore.java │ │ ├── NetProviderStore.java │ │ ├── OutputFormat.java │ │ ├── PerFacilityStore.java │ │ ├── SingleFileStore.java │ │ └── SymbolStore.java │ └── resources │ └── org │ └── firebirdsql │ └── internal │ └── tools │ └── sqlstates.sql ├── jaybird-native ├── build.gradle └── src │ └── main │ ├── java │ ├── module-info.java │ └── org │ │ └── firebirdsql │ │ ├── gds │ │ ├── impl │ │ │ └── jni │ │ │ │ ├── EmbeddedGDSFactoryPlugin.java │ │ │ │ ├── NativeGDSFactoryPlugin.java │ │ │ │ └── package-info.java │ │ └── ng │ │ │ └── jna │ │ │ ├── AbstractNativeDatabaseFactory.java │ │ │ ├── BigEndianDatatypeCoder.java │ │ │ ├── FbClientDatabaseFactory.java │ │ │ ├── FbClientFeature.java │ │ │ ├── FbClientFeatureAccess.java │ │ │ ├── FbClientFeatureAccessHandler.java │ │ │ ├── FbClientResource.java │ │ │ ├── FbEmbeddedDatabaseFactory.java │ │ │ ├── JnaAttachment.java │ │ │ ├── JnaBlob.java │ │ │ ├── JnaConnection.java │ │ │ ├── JnaDatabase.java │ │ │ ├── JnaDatabaseConnection.java │ │ │ ├── JnaEventHandle.java │ │ │ ├── JnaParameterConverter.java │ │ │ ├── JnaService.java │ │ │ ├── JnaServiceConnection.java │ │ │ ├── JnaStatement.java │ │ │ ├── JnaTransaction.java │ │ │ ├── LittleEndianDatatypeCoder.java │ │ │ ├── NativeConnectionPropertyDefiner.java │ │ │ ├── NativeLibraryLoadException.java │ │ │ ├── NativePropertyNames.java │ │ │ ├── NativeResourceTracker.java │ │ │ ├── NativeResourceUnloadAbstractWebListener.java │ │ │ └── package-info.java │ │ └── jna │ │ ├── embedded │ │ ├── FirebirdEmbeddedLookup.java │ │ ├── TemporaryFirebirdEmbeddedLibrary.java │ │ ├── classpath │ │ │ ├── ClasspathFirebirdEmbeddedLibrary.java │ │ │ ├── ClasspathFirebirdEmbeddedLoader.java │ │ │ ├── ClasspathFirebirdEmbeddedResource.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ └── spi │ │ │ ├── DisposableFirebirdEmbeddedLibrary.java │ │ │ ├── FirebirdEmbeddedLibrary.java │ │ │ ├── FirebirdEmbeddedLoadingException.java │ │ │ ├── FirebirdEmbeddedProvider.java │ │ │ └── package-info.java │ │ ├── fbclient │ │ ├── FbClientLibrary.java │ │ ├── GDS_QUAD_t.java │ │ ├── ISC_ARRAY_BOUND.java │ │ ├── ISC_ARRAY_DESC.java │ │ ├── ISC_BLOB_DESC.java │ │ ├── ISC_STATUS.java │ │ ├── ISC_TIMESTAMP.java │ │ ├── USER_SEC_DATA.java │ │ ├── WinFbClientLibrary.java │ │ ├── XSQLDA.java │ │ ├── XSQLVAR.java │ │ └── package-info.java │ │ └── jakarta │ │ └── NativeResourceUnloadWebListenerJakarta.java │ └── resources │ └── META-INF │ └── services │ ├── org.firebirdsql.gds.impl.GDSFactoryPlugin │ └── org.firebirdsql.jaybird.props.spi.ConnectionPropertyDefinerSpi ├── publish.gradle ├── settings.gradle └── src ├── docs ├── asciidoc │ ├── faq.adoc │ └── release_notes.adoc └── theme │ ├── fonts │ ├── NotoSans-Bold.ttf │ ├── NotoSans-BoldItalic.ttf │ ├── NotoSans-Italic.ttf │ └── NotoSans-Regular.ttf │ └── jaybird-html │ ├── README.md │ ├── docinfo │ └── docinfo-footer.html │ └── firebird.css ├── extern └── org │ └── firebirdsql │ └── extern │ └── decimal │ ├── Decimal.java │ ├── Decimal128.java │ ├── Decimal32.java │ ├── Decimal64.java │ ├── DecimalCodec.java │ ├── DecimalFactory.java │ ├── DecimalFormat.java │ ├── DecimalInconvertibleException.java │ ├── DecimalOverflowException.java │ ├── DecimalType.java │ ├── DenselyPackedDecimalCodec.java │ ├── OverflowHandling.java │ ├── Signum.java │ └── package-info.java ├── jna-test └── org │ └── firebirdsql │ └── gds │ └── ng │ └── jna │ ├── BigEndianDatatypeCoderTest.java │ ├── FbClientResourceTest.java │ ├── JnaBlobInputTest.java │ ├── JnaBlobOutputTest.java │ ├── JnaDatabaseConnectionTest.java │ ├── JnaDatabaseTest.java │ ├── JnaEventsTest.java │ ├── JnaServiceConnectionTest.java │ ├── JnaServiceTest.java │ ├── JnaStatementTest.java │ ├── JnaStatementTimeoutTest.java │ ├── JnaTransactionTest.java │ └── LittleEndianDatatypeCoderTest.java ├── main ├── module-info.java └── org │ └── firebirdsql │ ├── ds │ ├── AbstractConnectionPropertiesDataSource.java │ ├── DataSourceFactory.java │ ├── FBAbstractCommonDataSource.java │ ├── FBConnectionPoolDataSource.java │ ├── FBPooledConnection.java │ ├── FBSimpleDataSource.java │ ├── FBXAConnection.java │ ├── FBXADataSource.java │ ├── PooledConnectionHandler.java │ ├── RootCommonDataSource.java │ ├── StatementHandler.java │ ├── XAConnectionHandler.java │ └── package-info.java │ ├── encodings │ ├── ConnectionEncodingFactory.java │ ├── DefaultEncodingDefinition.java │ ├── DefaultEncodingSet.java │ ├── Encoding.java │ ├── EncodingDefinition.java │ ├── EncodingFactory.java │ ├── EncodingGeneric.java │ ├── EncodingSet.java │ ├── IEncodingFactory.java │ └── package-info.java │ ├── event │ ├── DatabaseEvent.java │ ├── DatabaseEventImpl.java │ ├── EventListener.java │ ├── EventManager.java │ ├── FBEventManager.java │ ├── OneTimeEventListener.java │ └── package-info.java │ ├── gds │ ├── BatchParameterBuffer.java │ ├── BlobParameterBuffer.java │ ├── BlrConstants.java │ ├── ClumpletReader.java │ ├── ConnectionParameterBuffer.java │ ├── DatabaseParameterBuffer.java │ ├── DefaultMessageTemplate.java │ ├── EventHandle.java │ ├── EventHandler.java │ ├── ISCConstants.java │ ├── JaybirdErrorCodes.java │ ├── JaybirdSystemProperties.java │ ├── MessageLoader.java │ ├── MessageLookup.java │ ├── MessageTemplate.java │ ├── OverriddenSqlStateMessageTemplate.java │ ├── Parameter.java │ ├── ParameterBuffer.java │ ├── ParameterTagMapping.java │ ├── ServiceParameterBuffer.java │ ├── ServiceRequestBuffer.java │ ├── TransactionParameterBuffer.java │ ├── VaxEncoding.java │ ├── impl │ │ ├── BaseGDSFactoryPlugin.java │ │ ├── BatchParameterBufferImp.java │ │ ├── BlobParameterBufferImp.java │ │ ├── DatabaseParameterBufferImp.java │ │ ├── DbAttachInfo.java │ │ ├── GDSFactory.java │ │ ├── GDSFactoryPlugin.java │ │ ├── GDSHelper.java │ │ ├── GDSServerVersion.java │ │ ├── GDSServerVersionException.java │ │ ├── GDSType.java │ │ ├── ParameterBufferBase.java │ │ ├── ParameterBufferMetaData.java │ │ ├── ServiceParameterBufferImp.java │ │ ├── ServiceRequestBufferImp.java │ │ ├── TransactionParameterBufferImpl.java │ │ ├── argument │ │ │ ├── Argument.java │ │ │ ├── ArgumentType.java │ │ │ ├── BigIntArgument.java │ │ │ ├── ByteArgument.java │ │ │ ├── ByteArrayArgument.java │ │ │ ├── NumericArgument.java │ │ │ ├── SingleItem.java │ │ │ ├── StringArgument.java │ │ │ ├── TypedArgument.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ └── wire │ │ │ ├── EncryptedStreamSupport.java │ │ │ ├── FbCipherInputStream.java │ │ │ ├── FbDeflaterOutputStream.java │ │ │ ├── FbInflaterInputStream.java │ │ │ ├── WireGDSFactoryPlugin.java │ │ │ ├── WireProtocolConstants.java │ │ │ ├── XdrInputStream.java │ │ │ ├── XdrOutputStream.java │ │ │ ├── Xdrable.java │ │ │ └── package-info.java │ ├── ng │ │ ├── AbstractAttachProperties.java │ │ ├── AbstractConnection.java │ │ ├── AbstractEventHandle.java │ │ ├── AbstractFbAttachment.java │ │ ├── AbstractFbBlob.java │ │ ├── AbstractFbDatabase.java │ │ ├── AbstractFbService.java │ │ ├── AbstractFbStatement.java │ │ ├── AbstractFbTransaction.java │ │ ├── AbstractImmutableAttachProperties.java │ │ ├── AbstractParameterConverter.java │ │ ├── BatchCompletion.java │ │ ├── BlobConfig.java │ │ ├── BlobHelper.java │ │ ├── BlobLengthProcessor.java │ │ ├── CachedInfoResponse.java │ │ ├── CursorFlag.java │ │ ├── DatatypeCoder.java │ │ ├── DefaultDatatypeCoder.java │ │ ├── DeferredResponse.java │ │ ├── EncodingSpecificDatatypeCoder.java │ │ ├── ExecutionPlanProcessor.java │ │ ├── FbAttachment.java │ │ ├── FbBatchConfig.java │ │ ├── FbBlob.java │ │ ├── FbConnectionProperties.java │ │ ├── FbDatabase.java │ │ ├── FbDatabaseFactory.java │ │ ├── FbDatabaseOperation.java │ │ ├── FbExceptionBuilder.java │ │ ├── FbImmutableConnectionProperties.java │ │ ├── FbImmutableServiceProperties.java │ │ ├── FbService.java │ │ ├── FbServiceProperties.java │ │ ├── FbStatement.java │ │ ├── FbTransaction.java │ │ ├── FetchDirection.java │ │ ├── FetchType.java │ │ ├── IAttachProperties.java │ │ ├── IConnectionProperties.java │ │ ├── IServiceProperties.java │ │ ├── InfoProcessor.java │ │ ├── InfoTruncatedException.java │ │ ├── LockCloseable.java │ │ ├── OdsVersion.java │ │ ├── OperationCloseHandle.java │ │ ├── OperationMonitor.java │ │ ├── ParameterConverter.java │ │ ├── ServerVersionInformation.java │ │ ├── SqlCountHolder.java │ │ ├── SqlCountProcessor.java │ │ ├── StatementInfoProcessor.java │ │ ├── StatementState.java │ │ ├── StatementType.java │ │ ├── TransactionHelper.java │ │ ├── TransactionState.java │ │ ├── WarningMessageCallback.java │ │ ├── WireCrypt.java │ │ ├── dbcrypt │ │ │ ├── DbCryptCallback.java │ │ │ ├── DbCryptCallbackSpi.java │ │ │ ├── DbCryptData.java │ │ │ ├── package-info.java │ │ │ └── simple │ │ │ │ ├── StaticValueDbCryptCallback.java │ │ │ │ ├── StaticValueDbCryptCallbackSpi.java │ │ │ │ └── package-info.java │ │ ├── fields │ │ │ ├── BlrCalculator.java │ │ │ ├── FieldDescriptor.java │ │ │ ├── RowDescriptor.java │ │ │ ├── RowDescriptorBuilder.java │ │ │ ├── RowValue.java │ │ │ └── package-info.java │ │ ├── listeners │ │ │ ├── AbstractListenerDispatcher.java │ │ │ ├── DatabaseListener.java │ │ │ ├── DatabaseListenerDispatcher.java │ │ │ ├── ExceptionListenable.java │ │ │ ├── ExceptionListener.java │ │ │ ├── ExceptionListenerDispatcher.java │ │ │ ├── ServiceListener.java │ │ │ ├── ServiceListenerDispatcher.java │ │ │ ├── StatementListener.java │ │ │ ├── StatementListenerDispatcher.java │ │ │ ├── TransactionListener.java │ │ │ ├── TransactionListenerDispatcher.java │ │ │ └── package-info.java │ │ ├── monitor │ │ │ ├── Operation.java │ │ │ ├── OperationAware.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ ├── tz │ │ │ ├── TimeZoneDatatypeCoder.java │ │ │ ├── TimeZoneMapping.java │ │ │ └── package-info.java │ │ └── wire │ │ │ ├── AbstractFbWireBlob.java │ │ │ ├── AbstractFbWireDatabase.java │ │ │ ├── AbstractFbWireInputBlob.java │ │ │ ├── AbstractFbWireOutputBlob.java │ │ │ ├── AbstractFbWireService.java │ │ │ ├── AbstractFbWireStatement.java │ │ │ ├── AbstractProtocolDescriptor.java │ │ │ ├── AbstractWireOperations.java │ │ │ ├── AsyncFetchStatus.java │ │ │ ├── AsynchronousChannelListener.java │ │ │ ├── AsynchronousChannelListenerDispatcher.java │ │ │ ├── AsynchronousProcessor.java │ │ │ ├── BatchCompletionResponse.java │ │ │ ├── DefaultBlrCalculator.java │ │ │ ├── DeferredAction.java │ │ │ ├── FbWireAsynchronousChannel.java │ │ │ ├── FbWireAttachment.java │ │ │ ├── FbWireBlob.java │ │ │ ├── FbWireDatabase.java │ │ │ ├── FbWireDatabaseFactory.java │ │ │ ├── FbWireOperations.java │ │ │ ├── FbWireService.java │ │ │ ├── FbWireStatement.java │ │ │ ├── FbWireTransaction.java │ │ │ ├── FetchResponse.java │ │ │ ├── GenericResponse.java │ │ │ ├── InlineBlob.java │ │ │ ├── InlineBlobCache.java │ │ │ ├── InlineBlobResponse.java │ │ │ ├── ProtocolCollection.java │ │ │ ├── ProtocolDescriptor.java │ │ │ ├── Response.java │ │ │ ├── SqlResponse.java │ │ │ ├── WireConnection.java │ │ │ ├── WireDatabaseConnection.java │ │ │ ├── WireEventHandle.java │ │ │ ├── WireServiceConnection.java │ │ │ ├── XdrStreamAccess.java │ │ │ ├── auth │ │ │ ├── AuthenticationPlugin.java │ │ │ ├── AuthenticationPluginRegistry.java │ │ │ ├── AuthenticationPluginSpi.java │ │ │ ├── ClientAuthBlock.java │ │ │ ├── legacy │ │ │ │ ├── LegacyAuthenticationPlugin.java │ │ │ │ ├── LegacyAuthenticationPluginSpi.java │ │ │ │ ├── LegacyHash.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── srp │ │ │ │ ├── AbstractSrpAuthenticationPluginSpi.java │ │ │ │ ├── Srp224AuthenticationPluginSpi.java │ │ │ │ ├── Srp256AuthenticationPluginSpi.java │ │ │ │ ├── Srp384AuthenticationPluginSpi.java │ │ │ │ ├── Srp512AuthenticationPluginSpi.java │ │ │ │ ├── SrpAuthenticationPlugin.java │ │ │ │ ├── SrpAuthenticationPluginSpi.java │ │ │ │ ├── SrpClient.java │ │ │ │ └── package-info.java │ │ │ ├── crypt │ │ │ ├── CryptConnectionInfo.java │ │ │ ├── CryptSessionConfig.java │ │ │ ├── CryptSessionConfigImpl.java │ │ │ ├── EncryptionIdentifier.java │ │ │ ├── EncryptionInitInfo.java │ │ │ ├── EncryptionPlugin.java │ │ │ ├── EncryptionPluginRegistry.java │ │ │ ├── EncryptionPluginSpi.java │ │ │ ├── FBSQLEncryptException.java │ │ │ ├── KnownServerKey.java │ │ │ ├── arc4 │ │ │ │ ├── Arc4EncryptionPlugin.java │ │ │ │ ├── Arc4EncryptionPluginSpi.java │ │ │ │ └── package-info.java │ │ │ ├── chacha │ │ │ │ ├── ChaChaEncryptionPlugin.java │ │ │ │ ├── ChaChaEncryptionPluginSpi.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── version10 │ │ │ ├── V10AsynchronousChannel.java │ │ │ ├── V10Database.java │ │ │ ├── V10InputBlob.java │ │ │ ├── V10OutputBlob.java │ │ │ ├── V10ParameterConverter.java │ │ │ ├── V10Service.java │ │ │ ├── V10Statement.java │ │ │ ├── V10Transaction.java │ │ │ ├── V10WireOperations.java │ │ │ ├── Version10Descriptor.java │ │ │ └── package-info.java │ │ │ ├── version11 │ │ │ ├── V11Database.java │ │ │ ├── V11InputBlob.java │ │ │ ├── V11OutputBlob.java │ │ │ ├── V11ParameterConverter.java │ │ │ ├── V11Statement.java │ │ │ ├── V11WireOperations.java │ │ │ ├── Version11Descriptor.java │ │ │ └── package-info.java │ │ │ ├── version12 │ │ │ ├── V12Database.java │ │ │ ├── V12ParameterConverter.java │ │ │ ├── V12Statement.java │ │ │ ├── Version12Descriptor.java │ │ │ └── package-info.java │ │ │ ├── version13 │ │ │ ├── V13Database.java │ │ │ ├── V13ParameterConverter.java │ │ │ ├── V13Statement.java │ │ │ ├── V13WireOperations.java │ │ │ ├── Version13Descriptor.java │ │ │ └── package-info.java │ │ │ ├── version15 │ │ │ ├── V15Database.java │ │ │ ├── V15WireOperations.java │ │ │ ├── Version15Descriptor.java │ │ │ └── package-info.java │ │ │ ├── version16 │ │ │ ├── V16Database.java │ │ │ ├── V16Statement.java │ │ │ ├── V16WireOperations.java │ │ │ ├── Version16Descriptor.java │ │ │ └── package-info.java │ │ │ ├── version18 │ │ │ ├── V18Database.java │ │ │ ├── V18Statement.java │ │ │ ├── V18WireOperations.java │ │ │ ├── Version18Descriptor.java │ │ │ └── package-info.java │ │ │ └── version19 │ │ │ ├── V19Database.java │ │ │ ├── V19Statement.java │ │ │ ├── V19WireOperations.java │ │ │ ├── Version19Descriptor.java │ │ │ └── package-info.java │ └── package-info.java │ ├── jaybird │ ├── Version.java │ ├── fb │ │ └── constants │ │ │ ├── BatchItems.java │ │ │ ├── BpbItems.java │ │ │ ├── DpbItems.java │ │ │ ├── SpbItems.java │ │ │ ├── StandardBlobTypes.java │ │ │ ├── TpbItems.java │ │ │ └── package-info.java │ ├── package-info.java │ ├── parser │ │ ├── AbstractSymbolToken.java │ │ ├── AbstractToken.java │ │ ├── AbstractTokenVisitor.java │ │ ├── BooleanLiteralToken.java │ │ ├── CharSequenceComparison.java │ │ ├── CloseToken.java │ │ ├── ColonToken.java │ │ ├── CommaToken.java │ │ ├── CommentToken.java │ │ ├── CurlyBraceClose.java │ │ ├── CurlyBraceOpen.java │ │ ├── FirebirdReservedWords.java │ │ ├── GenericToken.java │ │ ├── LiteralToken.java │ │ ├── LocalStatementClass.java │ │ ├── LocalStatementType.java │ │ ├── NullLiteralToken.java │ │ ├── NumericLiteralToken.java │ │ ├── OpenToken.java │ │ ├── OperatorToken.java │ │ ├── ParenthesisClose.java │ │ ├── ParenthesisOpen.java │ │ ├── PeriodToken.java │ │ ├── PositionalParameterToken.java │ │ ├── QuotedIdentifierToken.java │ │ ├── ReservedToken.java │ │ ├── ReservedWords.java │ │ ├── ReturningClauseDetector.java │ │ ├── SemicolonToken.java │ │ ├── SqlParser.java │ │ ├── SqlTokenizer.java │ │ ├── SquareBracketClose.java │ │ ├── SquareBracketOpen.java │ │ ├── StatementDetector.java │ │ ├── StatementIdentification.java │ │ ├── StringLiteralToken.java │ │ ├── Token.java │ │ ├── TokenVisitor.java │ │ ├── UnexpectedEndOfInputException.java │ │ ├── VisitorRegistrar.java │ │ ├── WhitespaceToken.java │ │ └── package-info.java │ ├── props │ │ ├── AttachmentProperties.java │ │ ├── BaseProperties.java │ │ ├── DatabaseConnectionProperties.java │ │ ├── DpbType.java │ │ ├── InvalidPropertyValueException.java │ │ ├── PropertyConstants.java │ │ ├── PropertyNames.java │ │ ├── ServiceConnectionProperties.java │ │ ├── def │ │ │ ├── ConnectionProperty.java │ │ │ ├── ConnectionPropertyType.java │ │ │ └── package-info.java │ │ ├── internal │ │ │ ├── ConnectionPropertyRegistry.java │ │ │ ├── StandardConnectionPropertyDefiner.java │ │ │ ├── TransactionNameMapping.java │ │ │ ├── UnregisteredDpbDefiner.java │ │ │ └── package-info.java │ │ ├── package-info.java │ │ └── spi │ │ │ ├── ConnectionPropertyDefinerSpi.java │ │ │ └── package-info.java │ ├── util │ │ ├── ByteArrayHelper.java │ │ ├── Cleaners.java │ │ ├── CollectionUtils.java │ │ ├── ConditionalHelpers.java │ │ ├── ExceptionHelper.java │ │ ├── FbDatetimeConversion.java │ │ ├── FunctionWrappingSQLExceptionThrowingFunction.java │ │ ├── IOUtils.java │ │ ├── LegacyDatetimeConversions.java │ │ ├── PluginLoader.java │ │ ├── Primitives.java │ │ ├── ReflectionHelper.java │ │ ├── SQLExceptionChainBuilder.java │ │ ├── SQLExceptionThrowingFunction.java │ │ ├── SQLExceptionThrowingFunctionWrappingFunction.java │ │ ├── StringUtils.java │ │ ├── UncheckedSQLException.java │ │ └── package-info.java │ └── xca │ │ ├── FBConnectionRequestInfo.java │ │ ├── FBIncorrectXidException.java │ │ ├── FBLocalTransaction.java │ │ ├── FBManagedConnection.java │ │ ├── FBManagedConnectionFactory.java │ │ ├── FBStandAloneConnectionManager.java │ │ ├── FBXAException.java │ │ ├── FBXid.java │ │ ├── FatalErrorHelper.java │ │ ├── XcaConnectionEvent.java │ │ ├── XcaConnectionEventListener.java │ │ ├── XcaConnectionManager.java │ │ └── package-info.java │ ├── jdbc │ ├── AbstractFetcher.java │ ├── AbstractFieldMetaData.java │ ├── AbstractStatement.java │ ├── Batch.java │ ├── ClientInfoProvider.java │ ├── CompletionReason.java │ ├── DbMetadataMediator.java │ ├── FBBlob.java │ ├── FBBlobInputStream.java │ ├── FBBlobOutputStream.java │ ├── FBCachedBlob.java │ ├── FBCachedFetcher.java │ ├── FBCallableStatement.java │ ├── FBClob.java │ ├── FBConnection.java │ ├── FBConnectionProperties.java │ ├── FBDataSource.java │ ├── FBDatabaseMetaData.java │ ├── FBDriver.java │ ├── FBDriverNotCapableException.java │ ├── FBDriverPropertyManager.java │ ├── FBFetcher.java │ ├── FBObjectListener.java │ ├── FBParameterMetaData.java │ ├── FBPreparedStatement.java │ ├── FBProcedureCall.java │ ├── FBProcedureParam.java │ ├── FBResultSet.java │ ├── FBResultSetMetaData.java │ ├── FBResultSetNotUpdatableException.java │ ├── FBRowId.java │ ├── FBRowUpdater.java │ ├── FBSQLExceptionInfo.java │ ├── FBSavepoint.java │ ├── FBServerScrollFetcher.java │ ├── FBStatement.java │ ├── FBStatementFetcher.java │ ├── FBTpbMapper.java │ ├── FBTxPreparedStatement.java │ ├── FBUpdatableCursorFetcher.java │ ├── FBUpdatableFetcher.java │ ├── FetchConfig.java │ ├── FirebirdBlob.java │ ├── FirebirdCallableStatement.java │ ├── FirebirdClob.java │ ├── FirebirdConnection.java │ ├── FirebirdConnectionProperties.java │ ├── FirebirdDatabaseMetaData.java │ ├── FirebirdDriver.java │ ├── FirebirdParameterMetaData.java │ ├── FirebirdPreparedStatement.java │ ├── FirebirdResultSet.java │ ├── FirebirdResultSetMetaData.java │ ├── FirebirdRowId.java │ ├── FirebirdRowUpdater.java │ ├── FirebirdSavepoint.java │ ├── FirebirdStatement.java │ ├── FirebirdVersionMetaData.java │ ├── ForwardOnlyFetcherDecorator.java │ ├── GeneratedKeysQueryBuilder.java │ ├── GeneratedKeysSupport.java │ ├── GeneratedKeysSupportFactory.java │ ├── InternalTransactionCoordinator.java │ ├── JavaTypeNameConstants.java │ ├── JaybirdType.java │ ├── JaybirdTypeCodes.java │ ├── QuoteStrategy.java │ ├── ResultSetBehavior.java │ ├── SQLStateConstants.java │ ├── ServerBatch.java │ ├── StoredProcedureMetaData.java │ ├── StoredProcedureMetaDataFactory.java │ ├── escape │ │ ├── CharacterLengthFunction.java │ │ ├── ConstantSQLFunction.java │ │ ├── ConvertFunction.java │ │ ├── FBEscapedCallParser.java │ │ ├── FBEscapedFunctionHelper.java │ │ ├── FBEscapedParser.java │ │ ├── FBSQLParseException.java │ │ ├── IntervalMapping.java │ │ ├── LengthFunction.java │ │ ├── LocateFunction.java │ │ ├── PatternSQLFunction.java │ │ ├── PositionFunction.java │ │ ├── SQLFunction.java │ │ ├── TimestampAddFunction.java │ │ ├── TimestampDiffFunction.java │ │ └── package-info.java │ ├── field │ │ ├── AbstractWithTimeZoneField.java │ │ ├── AbstractWithoutTimeZoneField.java │ │ ├── BlobListenableField.java │ │ ├── FBBigDecimalField.java │ │ ├── FBBinaryField.java │ │ ├── FBBlobField.java │ │ ├── FBBooleanField.java │ │ ├── FBCachedBlobField.java │ │ ├── FBCachedClob.java │ │ ├── FBCachedLongVarCharField.java │ │ ├── FBCloseableField.java │ │ ├── FBDateField.java │ │ ├── FBDecfloatField.java │ │ ├── FBDoubleField.java │ │ ├── FBField.java │ │ ├── FBFloatField.java │ │ ├── FBFlushableField.java │ │ ├── FBIntegerField.java │ │ ├── FBLongField.java │ │ ├── FBLongVarCharField.java │ │ ├── FBNullField.java │ │ ├── FBRowIdField.java │ │ ├── FBShortField.java │ │ ├── FBStringField.java │ │ ├── FBTimeField.java │ │ ├── FBTimeTzField.java │ │ ├── FBTimestampField.java │ │ ├── FBTimestampTzField.java │ │ ├── FieldDataProvider.java │ │ ├── JdbcTypeConverter.java │ │ ├── TrimmableField.java │ │ ├── TypeConversionException.java │ │ └── package-info.java │ ├── metadata │ │ ├── AbstractKeysMethod.java │ │ ├── AbstractMetadataMethod.java │ │ ├── CatalogMetadataInfo.java │ │ ├── Clause.java │ │ ├── FbMetadataConstants.java │ │ ├── GetAttributes.java │ │ ├── GetBestRowIdentifier.java │ │ ├── GetCatalogs.java │ │ ├── GetClientInfoProperties.java │ │ ├── GetColumnPrivileges.java │ │ ├── GetColumns.java │ │ ├── GetCrossReference.java │ │ ├── GetExportedKeys.java │ │ ├── GetFunctionColumns.java │ │ ├── GetFunctions.java │ │ ├── GetImportedKeys.java │ │ ├── GetIndexInfo.java │ │ ├── GetPrimaryKeys.java │ │ ├── GetProcedureColumns.java │ │ ├── GetProcedures.java │ │ ├── GetPseudoColumns.java │ │ ├── GetSchemas.java │ │ ├── GetSuperTables.java │ │ ├── GetSuperTypes.java │ │ ├── GetTablePrivileges.java │ │ ├── GetTables.java │ │ ├── GetTypeInfo.java │ │ ├── GetUDTs.java │ │ ├── GetVersionColumns.java │ │ ├── MetadataPattern.java │ │ ├── MetadataPatternMatcher.java │ │ ├── NameHelper.java │ │ ├── PrivilegeMapping.java │ │ ├── RowValueBuilder.java │ │ ├── TypeMetadata.java │ │ └── package-info.java │ └── package-info.java │ ├── management │ ├── BackupManager.java │ ├── FBBackupManager.java │ ├── FBBackupManagerBase.java │ ├── FBCommandLine.java │ ├── FBMaintenanceManager.java │ ├── FBManager.java │ ├── FBManagerMBean.java │ ├── FBNBackupManager.java │ ├── FBServiceManager.java │ ├── FBStatisticsManager.java │ ├── FBStreamingBackupManager.java │ ├── FBTableStatisticsManager.java │ ├── FBTraceManager.java │ ├── FBUser.java │ ├── FBUserManager.java │ ├── MaintenanceManager.java │ ├── NBackupManager.java │ ├── PageSizeConstants.java │ ├── ServiceManager.java │ ├── StatisticsManager.java │ ├── TableStatistics.java │ ├── TraceManager.java │ ├── User.java │ ├── UserManager.java │ └── package-info.java │ └── util │ ├── FirebirdSupportInfo.java │ ├── InternalApi.java │ ├── NumericHelper.java │ ├── Volatile.java │ └── package-info.java ├── resources ├── META-INF │ └── services │ │ ├── java.sql.Driver │ │ ├── org.firebirdsql.encodings.EncodingSet │ │ ├── org.firebirdsql.gds.impl.GDSFactoryPlugin │ │ ├── org.firebirdsql.gds.ng.wire.ProtocolDescriptor │ │ ├── org.firebirdsql.gds.ng.wire.auth.AuthenticationPluginSpi │ │ └── org.firebirdsql.gds.ng.wire.crypt.EncryptionPluginSpi └── org │ └── firebirdsql │ ├── firebird_0_error_msg.properties │ ├── firebird_0_sql_states.properties │ ├── firebird_12_error_msg.properties │ ├── firebird_12_sql_states.properties │ ├── firebird_13_error_msg.properties │ ├── firebird_13_sql_states.properties │ ├── firebird_14_error_msg.properties │ ├── firebird_15_error_msg.properties │ ├── firebird_17_error_msg.properties │ ├── firebird_18_error_msg.properties │ ├── firebird_18_sql_states.properties │ ├── firebird_21_error_msg.properties │ ├── firebird_21_sql_states.properties │ ├── firebird_22_error_msg.properties │ ├── firebird_22_sql_states.properties │ ├── firebird_23_error_msg.properties │ ├── firebird_23_sql_states.properties │ ├── firebird_24_error_msg.properties │ ├── firebird_24_sql_states.properties │ ├── firebird_25_error_msg.properties │ ├── firebird_25_sql_states.properties │ ├── firebird_3_error_msg.properties │ ├── firebird_3_sql_states.properties │ ├── firebird_7_error_msg.properties │ ├── firebird_7_sql_states.properties │ ├── firebird_8_error_msg.properties │ ├── firebird_8_sql_states.properties │ ├── gds │ └── ng │ │ └── tz │ │ └── firebird_time_zone_mapping.properties │ ├── jaybird │ └── version.properties │ ├── jaybird_error_msg.properties │ ├── jaybird_error_sqlstates.properties │ └── jdbc │ ├── reserved_words_2_0.txt │ ├── reserved_words_2_1.txt │ ├── reserved_words_2_5.txt │ ├── reserved_words_3_0.txt │ ├── reserved_words_4_0.txt │ └── reserved_words_5_0.txt ├── test └── org │ └── firebirdsql │ ├── common │ ├── BaseSocketFactory.java │ ├── BlackholeServer.java │ ├── ConfigHelper.java │ ├── DataGenerator.java │ ├── DdlHelper.java │ ├── FBTestProperties.java │ ├── FbAssumptions.java │ ├── FeatureCheck.java │ ├── InfoResponseWriter.java │ ├── JdbcResourceHelper.java │ ├── NoArgSocketFactory.java │ ├── PropertiesSocketFactory.java │ ├── SimpleServer.java │ ├── StreamHelper.java │ ├── StreamHelperTest.java │ ├── StringSocketFactory.java │ ├── SystemPropertyHelper.java │ ├── SystemPropertyHelperTest.java │ ├── assertions │ │ ├── CustomAssertions.java │ │ ├── ResultSetAssertions.java │ │ └── SQLExceptionAssertions.java │ ├── extension │ │ ├── DatabaseExistsExtension.java │ │ ├── DatabaseUserExtension.java │ │ ├── GdsTypeExtension.java │ │ ├── RequireFeatureExtension.java │ │ ├── RequireProtocolExtension.java │ │ ├── RunEnvironmentExtension.java │ │ └── UsesDatabaseExtension.java │ ├── function │ │ ├── ThrowingBiConsumer.java │ │ ├── ThrowingBiFunction.java │ │ ├── ThrowingTriConsumer.java │ │ └── UncheckedCloseable.java │ └── matchers │ │ ├── ComparableMatcherFactory.java │ │ ├── GdsTypeMatchers.java │ │ ├── MatcherAssume.java │ │ ├── RegexMatcher.java │ │ └── SQLExceptionMatchers.java │ ├── ds │ ├── ConnectionEventMatcher.java │ ├── DataSourceBeanIntrospectionTest.java │ ├── DataSourceFactoryTest.java │ ├── FBConnectionPoolDataSourceTest.java │ ├── FBConnectionPoolTestBase.java │ ├── FBPooledConnectionMockTest.java │ ├── FBSimpleDataSourceTest.java │ ├── FBXADataSourceTest.java │ ├── PooledConnectionHandlerMockTest.java │ ├── PooledConnectionHandlerTest.java │ └── StatementHandlerMockTest.java │ ├── encodings │ ├── CharacterDecodingTest.java │ ├── ConnectionEncodingFactoryTest.java │ ├── DefaultEncodingSetTest.java │ └── EncodingFactoryTest.java │ ├── event │ └── FBEventManagerTest.java │ ├── gds │ ├── MessageTemplateTest.java │ ├── ReconnectTransactionTest.java │ ├── VaxEncodingTest.java │ ├── impl │ │ ├── DbAttachInfoTest.java │ │ ├── GDSFactoryTest.java │ │ ├── GDSHelperTest.java │ │ ├── GDSServerVersionTest.java │ │ └── jni │ │ │ └── SpecialEmbeddedServerUrlsTest.java │ └── ng │ │ ├── AbstractStatementTest.java │ │ ├── AbstractStatementTimeoutTest.java │ │ ├── AbstractTransactionTest.java │ │ ├── BaseTestBlob.java │ │ ├── BaseTestInputBlob.java │ │ ├── BaseTestOutputBlob.java │ │ ├── CachedInfoResponseTest.java │ │ ├── DefaultDatatypeCoderMockTest.java │ │ ├── DefaultDatatypeCoderTest.java │ │ ├── EmptyProtocolDescriptor.java │ │ ├── EncodingSpecificDatatypeCoderTest.java │ │ ├── FbConnectionPropertiesTest.java │ │ ├── FbDatabaseOperationTest.java │ │ ├── FbExceptionBuilderTest.java │ │ ├── FbServicePropertiesTest.java │ │ ├── JaybirdBlobBackupProblemTest.java │ │ ├── OdsVersionTest.java │ │ ├── OperationMonitorTest.java │ │ ├── ServerVersionInformationTest.java │ │ ├── ServicesAPITest.java │ │ ├── SimpleDatabaseListener.java │ │ ├── SimpleEventHandler.java │ │ ├── SimpleWarningMessageCallback.java │ │ ├── SqlCountHolderTest.java │ │ ├── TestOperationAware.java │ │ ├── TransactionHelperTest.java │ │ ├── dbcrypt │ │ ├── DbCryptDataTest.java │ │ └── simple │ │ │ ├── StaticValueDbCryptCallbackSpiTest.java │ │ │ └── StaticValueDbCryptCallbackTest.java │ │ ├── fields │ │ ├── FieldDescriptorTest.java │ │ ├── RowDescriptorBuilderTest.java │ │ └── RowValueTest.java │ │ ├── listeners │ │ ├── DatabaseListenerDispatcherTest.java │ │ ├── ServiceListenerDispatcherTest.java │ │ ├── StatementListenerDispatcherTest.java │ │ └── TransactionListenerDispatcherTest.java │ │ ├── tz │ │ ├── TimeZoneByNameMappingTest.java │ │ ├── TimeZoneCodecAbstractTest.java │ │ ├── TimeZoneCodecAbstractTimeTzTest.java │ │ ├── TimeZoneCodecAbstractTimestampTzTest.java │ │ ├── TimeZoneCodecExtendedTimeTzTest.java │ │ ├── TimeZoneCodecExtendedTimestampTzTest.java │ │ ├── TimeZoneCodecStandardTimeTzTest.java │ │ ├── TimeZoneCodecStandardTimestampTzTest.java │ │ ├── TimeZoneDatatypeCoderTest.java │ │ ├── TimeZoneMappingTest.java │ │ └── TimeZoneOffsetMappingTest.java │ │ └── wire │ │ ├── InlineBlobCacheTest.java │ │ ├── InlineBlobTest.java │ │ ├── ProtocolCollectionTest.java │ │ ├── SimpleChannelListener.java │ │ ├── SimpleStatementListener.java │ │ ├── WireDatabaseConnectionTest.java │ │ ├── auth │ │ ├── ClientAuthBlockNormalizeLoginTest.java │ │ ├── Firebird3PlusAuthenticationTest.java │ │ └── srp │ │ │ └── SrpClientTest.java │ │ ├── crypt │ │ ├── EncryptionInitInfoTest.java │ │ ├── arc4 │ │ │ └── Arc4EncryptionPluginSpiTest.java │ │ └── chacha │ │ │ └── ChaChaEncryptionPluginSpiTest.java │ │ ├── version10 │ │ ├── V10CommonConnectionInfo.java │ │ ├── V10DatabaseTest.java │ │ ├── V10EventHandlingTest.java │ │ ├── V10InputBlobMockTest.java │ │ ├── V10InputBlobTest.java │ │ ├── V10OutputBlobMockTest.java │ │ ├── V10OutputBlobTest.java │ │ ├── V10ServiceTest.java │ │ ├── V10StatementTest.java │ │ ├── V10TransactionTest.java │ │ └── V10WireOperationsTest.java │ │ ├── version11 │ │ ├── V11CommonConnectionInfo.java │ │ ├── V11DatabaseTest.java │ │ ├── V11EventHandlingTest.java │ │ ├── V11InputBlobTest.java │ │ ├── V11OutputBlobTest.java │ │ ├── V11ServiceTest.java │ │ ├── V11StatementTest.java │ │ ├── V11TransactionTest.java │ │ └── V11WireOperationsTest.java │ │ ├── version12 │ │ ├── V12CommonConnectionInfo.java │ │ ├── V12DatabaseTest.java │ │ ├── V12EventHandlingTest.java │ │ ├── V12InputBlobTest.java │ │ ├── V12OutputBlobTest.java │ │ ├── V12ServiceTest.java │ │ ├── V12StatementTest.java │ │ ├── V12TransactionTest.java │ │ └── V12WireOperationsTest.java │ │ ├── version13 │ │ ├── V13CommonConnectionInfo.java │ │ ├── V13DatabaseTest.java │ │ ├── V13EventHandlingTest.java │ │ ├── V13InputBlobTest.java │ │ ├── V13OutputBlobTest.java │ │ ├── V13ServiceTest.java │ │ ├── V13StatementTest.java │ │ ├── V13TransactionTest.java │ │ └── V13WireOperationsTest.java │ │ ├── version15 │ │ ├── V15CommonConnectionInfo.java │ │ ├── V15DatabaseTest.java │ │ ├── V15EventHandlingTest.java │ │ ├── V15InputBlobTest.java │ │ ├── V15OutputBlobTest.java │ │ ├── V15ServiceTest.java │ │ ├── V15StatementTest.java │ │ ├── V15TransactionTest.java │ │ └── V15WireOperationsTest.java │ │ ├── version16 │ │ ├── V16CommonConnectionInfo.java │ │ ├── V16DatabaseTest.java │ │ ├── V16EventHandlingTest.java │ │ ├── V16InputBlobTest.java │ │ ├── V16OutputBlobTest.java │ │ ├── V16ServiceTest.java │ │ ├── V16StatementTest.java │ │ ├── V16StatementTimeoutTest.java │ │ ├── V16TransactionTest.java │ │ └── V16WireOperationsTest.java │ │ ├── version18 │ │ ├── V18CommonConnectionInfo.java │ │ ├── V18DatabaseTest.java │ │ ├── V18EventHandlingTest.java │ │ ├── V18InputBlobTest.java │ │ ├── V18OutputBlobTest.java │ │ ├── V18ServiceTest.java │ │ ├── V18StatementTest.java │ │ ├── V18StatementTimeoutTest.java │ │ ├── V18TransactionTest.java │ │ └── V18WireOperationsTest.java │ │ └── version19 │ │ ├── V19CommonConnectionInfo.java │ │ ├── V19DatabaseTest.java │ │ ├── V19EventHandlingTest.java │ │ ├── V19InputBlobTest.java │ │ ├── V19OutputBlobTest.java │ │ ├── V19ServiceTest.java │ │ ├── V19StatementTest.java │ │ ├── V19StatementTimeoutTest.java │ │ ├── V19TransactionTest.java │ │ └── V19WireOperationsTest.java │ ├── jaybird │ ├── parser │ │ ├── BooleanLiteralTokenTest.java │ │ ├── FirebirdReservedWordsTest.java │ │ ├── GenericTokenTest.java │ │ ├── GrammarTest.java │ │ ├── QuotedIdentifierTokenTest.java │ │ ├── SqlParserTest.java │ │ ├── SqlTokenizerTest.java │ │ ├── StatementDetectorTest.java │ │ ├── StringLiteralTokenTest.java │ │ └── TokenSources.java │ ├── props │ │ ├── def │ │ │ ├── ConnectionPropertyTest.java │ │ │ └── ConnectionPropertyTypeTest.java │ │ └── internal │ │ │ ├── ConnectionPropertyRegistryTest.java │ │ │ └── TransactionNameMappingTest.java │ ├── util │ │ ├── ByteArrayHelperTest.java │ │ ├── CollectionUtilsTest.java │ │ ├── ConditionalHelpersTest.java │ │ ├── FbDatetimeConversionTest.java │ │ ├── LegacyDatetimeConversionsTest.java │ │ ├── SQLExceptionChainBuilderTest.java │ │ └── StringUtilsTest.java │ └── xca │ │ ├── DataSourceSerializationTest.java │ │ ├── FBBlobTest.java │ │ ├── FBConnectionTest.java │ │ ├── FBManagedConnectionFactoryTest.java │ │ ├── FBResultSetTest.java │ │ ├── FBStandAloneConnectionManagerTest.java │ │ ├── FBXAResourceTest.java │ │ ├── FBXidTest.java │ │ └── XidImpl.java │ ├── jdbc │ ├── AutoCommitBehaviourTest.java │ ├── BatchUpdatesTest.java │ ├── BooleanSupportTest.java │ ├── BoundaryTest.java │ ├── ClientInfoPropertyTest.java │ ├── ConnectionPropertiesTest.java │ ├── CreateDatabaseIfNotExistTest.java │ ├── DDLTest.java │ ├── DatabaseEncryptionTest.java │ ├── DatabaseUrlFormatsTest.java │ ├── DecfloatSupportTest.java │ ├── DecimalPrecision38SupportTest.java │ ├── Dialect1SpecificsTest.java │ ├── FBBlobAccessTest.java │ ├── FBBlobAutocommitTest.java │ ├── FBBlobInputStreamTest.java │ ├── FBBlobOutputStreamTest.java │ ├── FBBlobParamsTest.java │ ├── FBBlobStreamTest.java │ ├── FBBlobTest.java │ ├── FBCachedBlobTest.java │ ├── FBCallableStatementTest.java │ ├── FBClobTest.java │ ├── FBConnectionAllowTxStmtsTest.java │ ├── FBConnectionClientInfoPropertiesTest.java │ ├── FBConnectionPropertiesTest.java │ ├── FBConnectionTest.java │ ├── FBConnectionTimeoutTest.java │ ├── FBDatabaseMetaDataAbstractKeysTest.java │ ├── FBDatabaseMetaDataCatalogsTest.java │ ├── FBDatabaseMetaDataClientInfoPropertiesTest.java │ ├── FBDatabaseMetaDataColumnPrivilegesTest.java │ ├── FBDatabaseMetaDataColumnsTest.java │ ├── FBDatabaseMetaDataCrossReferenceTest.java │ ├── FBDatabaseMetaDataDialect1Test.java │ ├── FBDatabaseMetaDataExportedKeysTest.java │ ├── FBDatabaseMetaDataFunctionColumnsTest.java │ ├── FBDatabaseMetaDataFunctionsTest.java │ ├── FBDatabaseMetaDataImportedKeysTest.java │ ├── FBDatabaseMetaDataIndexInfoTest.java │ ├── FBDatabaseMetaDataNullsTest.java │ ├── FBDatabaseMetaDataPrimaryKeysTest.java │ ├── FBDatabaseMetaDataProcedureColumnsTest.java │ ├── FBDatabaseMetaDataProceduresTest.java │ ├── FBDatabaseMetaDataPseudoColumnsTest.java │ ├── FBDatabaseMetaDataTablePrivilegesTest.java │ ├── FBDatabaseMetaDataTablesTest.java │ ├── FBDatabaseMetaDataTest.java │ ├── FBDatabaseMetaDataUDTsTest.java │ ├── FBDatabaseMetaDataVersionColumnsTest.java │ ├── FBDecimalConversionsTest.java │ ├── FBDriverTest.java │ ├── FBEncodingsTest.java │ ├── FBLongVarCharEncodingsTest.java │ ├── FBParameterMetaDataTest.java │ ├── FBPreparedStatementGeneratedKeysTest.java │ ├── FBPreparedStatementMetaDataTest.java │ ├── FBPreparedStatementTest.java │ ├── FBPreparedStatementUTF8Test.java │ ├── FBResultSetMetaDataParametrizedTest.java │ ├── FBResultSetMetaDataTest.java │ ├── FBResultSetTest.java │ ├── FBRowIdTest.java │ ├── FBSavepointTest.java │ ├── FBServerScrollFetcherTest.java │ ├── FBStatementAllowTxStmtsTest.java │ ├── FBStatementGeneratedKeysTest.java │ ├── FBStatementTest.java │ ├── FBTestGeneratedKeysBase.java │ ├── FBTpbMapperNameMappingTest.java │ ├── FBTpbMapperTest.java │ ├── FBTxPreparedStatementTest.java │ ├── FBUnmanagedConnectionTest.java │ ├── FBUpdatableFetcherTest.java │ ├── FetchConfigTest.java │ ├── FetcherAssertions.java │ ├── FirebirdVersionMetaDataTest.java │ ├── GeneratedKeysEnabledTest.java │ ├── GeneratedKeysQueryTest.java │ ├── GeneratedKeysSupportFactoryTest.java │ ├── Int128SupportTest.java │ ├── JDBC42JavaTimeConversionsTest.java │ ├── JDBCUrlPrefixTest.java │ ├── LargeUpdateCountSupportTest.java │ ├── MetaDataInfo.java │ ├── MetadataResultSetDefinition.java │ ├── QuoteStrategyTest.java │ ├── ReconnectTest.java │ ├── ReservedWordsTest.java │ ├── ResultSetBehaviorTest.java │ ├── ResultSetGetObjectTest.java │ ├── RowIdSupportTest.java │ ├── SessionTimeZoneTest.java │ ├── SimpleFetcherListener.java │ ├── StringClob.java │ ├── TableReservationTest.java │ ├── TimeWithTimeZoneSupportTest.java │ ├── TimeZoneBindLegacyTest.java │ ├── TimeZoneBindTest.java │ ├── TimestampWithTimeZoneSupportTest.java │ ├── UseFirebirdAutocommitTest.java │ ├── escape │ │ ├── CharacterLengthFunctionTest.java │ │ ├── ConstantSQLFunctionTest.java │ │ ├── ConvertFunctionTest.java │ │ ├── EscapeFunctionAsserts.java │ │ ├── FBEscapedCallParserTest.java │ │ ├── FBEscapedFunctionHelperTest.java │ │ ├── FBEscapedParserTest.java │ │ ├── LengthFunctionTest.java │ │ ├── LikeEscapeTest.java │ │ ├── LimitEscapeTest.java │ │ ├── LocateFunctionTest.java │ │ ├── OuterJoinEscapesTest.java │ │ ├── PatternSQLFunctionTest.java │ │ ├── PositionFunctionTest.java │ │ ├── ScalarNumericFunctionsTest.java │ │ ├── ScalarStringFunctionsTest.java │ │ ├── ScalarSystemFunctionsTest.java │ │ ├── ScalarTimeDateFunctionsTest.java │ │ ├── TimeDateLiteralEscapesTest.java │ │ ├── TimestampAddFunctionTest.java │ │ └── TimestampDiffFunctionTest.java │ ├── field │ │ ├── BaseJUnit5TestFBField.java │ │ ├── FBBigDecimalFieldTest.java │ │ ├── FBBinaryFieldTest.java │ │ ├── FBBooleanFieldTest.java │ │ ├── FBDateFieldTest.java │ │ ├── FBDecfloatFieldTest.java │ │ ├── FBDoubleFieldTest.java │ │ ├── FBFloatFieldTest.java │ │ ├── FBIntegerFieldTest.java │ │ ├── FBLongFieldTest.java │ │ ├── FBNullFieldTest.java │ │ ├── FBRowIdFieldTest.java │ │ ├── FBShortFieldTest.java │ │ ├── FBStringFieldTest.java │ │ ├── FBTimeFieldTest.java │ │ ├── FBTimeTzFieldTest.java │ │ ├── FBTimestampFieldTest.java │ │ ├── FBTimestampTzFieldTest.java │ │ ├── JdbcTypeConverterTest.java │ │ └── TrimmableFieldTest.java │ └── metadata │ │ ├── ClauseTest.java │ │ ├── MetadataPatternMatcherTest.java │ │ ├── MetadataPatternTest.java │ │ └── NameHelperTest.java │ ├── management │ ├── FBBackupManagerTest.java │ ├── FBMaintenanceManagerTest.java │ ├── FBManagerTest.java │ ├── FBNBackupManagerTest.java │ ├── FBServiceManagerTest.java │ ├── FBStatisticsManagerTest.java │ ├── FBStreamingBackupManagerTest.java │ ├── FBTableStatisticsManagerTest.java │ └── FBUserManagerTest.java │ └── util │ ├── NumericHelperTest.java │ └── Unstable.java └── test_resources ├── org └── firebirdsql │ └── jdbc │ └── test_tpb_mapping.properties └── unit_test_defaults.properties /.gitattributes: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright 2015-2020 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | * text=auto 4 | 5 | *.css text 6 | *.df text 7 | *.htm text 8 | *.html text 9 | *.java text 10 | *.properties text 11 | *.sh text 12 | *.txt text 13 | *.xml text 14 | *.bat text eol=crlf 15 | 16 | *.class binary 17 | *.dll binary 18 | *.gif binary 19 | *.ico binary 20 | *.jar binary 21 | *.jpg binary 22 | *.jpeg binary 23 | *.png binary 24 | *.so binary 25 | 26 | gradlew text eol=lf -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2019-2022 Mark Rotteveel 2 | # SPDX-License-Identifier: CC0-1.0 3 | github: mrotteveel 4 | tidelift: maven/org.firebirdsql.jdbc:jaybird 5 | custom: https://firebirdsql.org/en/donate/ 6 | -------------------------------------------------------------------------------- /.github/workflows/reuse-compliance.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | name: REUSE Compliance Check 5 | 6 | on: 7 | push: 8 | branches: ['*'] 9 | pull_request: 10 | branches: ['*'] 11 | 12 | permissions: 13 | contents: read 14 | 15 | jobs: 16 | reuse: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | - name: REUSE Compliance Check 21 | uses: fsfe/reuse-action@v5 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright 2015-2023 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | output/ 4 | out/ 5 | gen/ 6 | build_*.bat 7 | .idea/ 8 | build-local.properties 9 | local-test-logging.properties 10 | classes/ 11 | *.iml 12 | *.eml 13 | *.fdb 14 | *.FDB 15 | .settings/ 16 | /junit*.properties 17 | .project 18 | .classpath 19 | 20 | # Ignore Gradle project-specific cache directory 21 | .gradle 22 | 23 | # Ignore Gradle build output directory 24 | build 25 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2020 Free Software Foundation Europe e.V. 2 | # SPDX-License-Identifier: CC0-1.0 3 | repos: 4 | - repo: https://github.com/fsfe/reuse-tool 5 | rev: v5.0.2 6 | hooks: 7 | - id: reuse 8 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | associated documentation files (the "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the 9 | following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial 12 | portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 15 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO 16 | EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 18 | USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /LICENSES/UnixCrypt.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 1996 Aki Yoshida. All rights reserved. 2 | 3 | Permission to use, copy, modify and distribute this software 4 | for non-commercial or commercial purposes and without fee is 5 | hereby granted provided that this copyright notice appears in 6 | all copies. 7 | -------------------------------------------------------------------------------- /build.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright 2013-2024 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | version.major=7 4 | version.minor=0 5 | version.revision=0 6 | # version.tag should start with a dash (-) unless it is empty 7 | version.tag=-SNAPSHOT 8 | # This must be set to the git tag for a release, otherwise to the branch 9 | version.svntag=master 10 | -------------------------------------------------------------------------------- /chacha64-plugin/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-CopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | @SuppressWarnings({ "JavaModuleNaming", "module" }) 4 | module org.firebirdsql.jaybird.chacha64 { 5 | requires org.firebirdsql.jaybird; 6 | requires org.bouncycastle.provider; 7 | 8 | provides org.firebirdsql.gds.ng.wire.crypt.EncryptionPluginSpi 9 | with org.firebirdsql.jaybird.chacha64.ChaCha64EncryptionPluginSpi; 10 | } 11 | -------------------------------------------------------------------------------- /chacha64-plugin/src/main/resources/META-INF/services/org.firebirdsql.gds.ng.wire.crypt.EncryptionPluginSpi: -------------------------------------------------------------------------------- 1 | org.firebirdsql.jaybird.chacha64.ChaCha64EncryptionPluginSpi 2 | -------------------------------------------------------------------------------- /doc-extension.groovy: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | docinfo_processor { 4 | document -> { 5 | if (!document.isBasebackend('html') || !document.hasAttribute('fb-canonical-html')) { 6 | return 7 | } 8 | return "" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/jaybird/809106994fee255586da59e1c5d6f59916ca825d/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /internal-tools/build.gradle: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | plugins { 4 | id 'java' 5 | } 6 | 7 | group = 'org.firebirdsql.jdbc' 8 | version = project.'version.maven' 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | -------------------------------------------------------------------------------- /internal-tools/src/main/java/org/firebirdsql/internal/tools/FirebirdErrorStore.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.internal.tools; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * Interface for storing Firebird error information. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 6 12 | */ 13 | interface FirebirdErrorStore { 14 | 15 | void addFirebirdError(FirebirdError firebirdError); 16 | 17 | /** 18 | * Resets this Firebird error store, clearing currently stored messages. 19 | */ 20 | void reset(); 21 | 22 | /** 23 | * Saves the messages to disk. 24 | * 25 | * @throws IOException 26 | * For failures to write the files. 27 | */ 28 | void save() throws IOException; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | module org.firebirdsql.jna { 4 | requires org.firebirdsql.jaybird; 5 | requires com.sun.jna; 6 | requires static jakarta.servlet; 7 | 8 | exports org.firebirdsql.jna.embedded.classpath; 9 | exports org.firebirdsql.jna.embedded.spi; 10 | exports org.firebirdsql.jna.jakarta; 11 | 12 | opens org.firebirdsql.jna.fbclient to com.sun.jna; 13 | 14 | uses org.firebirdsql.jna.embedded.spi.FirebirdEmbeddedProvider; 15 | 16 | provides org.firebirdsql.gds.impl.GDSFactoryPlugin 17 | with org.firebirdsql.gds.impl.jni.NativeGDSFactoryPlugin, 18 | org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin; 19 | 20 | provides org.firebirdsql.jaybird.props.spi.ConnectionPropertyDefinerSpi 21 | with org.firebirdsql.gds.ng.jna.NativeConnectionPropertyDefiner; 22 | } -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/gds/impl/jni/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementations of {@link org.firebirdsql.gds.impl.GDSFactoryPlugin} for native and embedded access. 5 | *

6 | * NOTE: For historic reasons the name of this package contains JNI, but the actual implementation uses JNA. 7 | *

8 | */ 9 | @InternalApi 10 | package org.firebirdsql.gds.impl.jni; 11 | 12 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/gds/ng/jna/FbClientFeatureAccess.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.jna; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | import java.util.Set; 8 | 9 | /** 10 | * Firebird client feature access. 11 | *

12 | * This interface allows checks for features of the Firebird client API. 13 | *

14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | @InternalApi 19 | public interface FbClientFeatureAccess { 20 | 21 | /** 22 | * Checks for presence of a client feature. 23 | * 24 | * @param clientFeature Client feature 25 | * @return {@code true} if the feature is present, {@code false} otherwise 26 | */ 27 | boolean hasFeature(FbClientFeature clientFeature); 28 | 29 | /** 30 | * @return an unmodifiable set with supported client features 31 | */ 32 | Set getFeatures(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/gds/ng/jna/NativeLibraryLoadException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.jna; 4 | 5 | /** 6 | * Thrown when a native library could not be loaded. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 4.0 10 | */ 11 | public class NativeLibraryLoadException extends RuntimeException { 12 | 13 | public NativeLibraryLoadException(String message, Throwable cause) { 14 | super(message, cause); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/gds/ng/jna/NativePropertyNames.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.jna; 4 | 5 | /** 6 | * Property names which are exclusively for use with jaybird-native. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 6 10 | */ 11 | @SuppressWarnings("java:S115") 12 | public final class NativePropertyNames { 13 | 14 | // NOTE: Only used/works for first native or embedded connection 15 | public static final String nativeLibraryPath = "nativeLibraryPath"; 16 | 17 | private NativePropertyNames() { 18 | // no instances 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/gds/ng/jna/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of the {@code org.firebirdsql.gds.ng} API for accessing Firebird using fbclient (native and embedded), 5 | * using the JNA (Java Native Access) library. 6 | * 7 | * @since 3 8 | */ 9 | @InternalApi 10 | package org.firebirdsql.gds.ng.jna; 11 | 12 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/embedded/classpath/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Supporting classes for implementations of {@link org.firebirdsql.jna.embedded.spi} to provide Firebird Embedded on 5 | * the classpath. 6 | * 7 | * @since 5 8 | */ 9 | package org.firebirdsql.jna.embedded.classpath; -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/embedded/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Provides look up of Firebird Embedded library SPIs as defined by {@link org.firebirdsql.jna.embedded.spi}. 5 | * 6 | * @since 5 7 | */ 8 | package org.firebirdsql.jna.embedded; -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/embedded/spi/DisposableFirebirdEmbeddedLibrary.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2020-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jna.embedded.spi; 4 | 5 | /** 6 | * Firebird Embedded library that needs to be disposed on exit. 7 | *

8 | * This can be used for additional cleanup on exit. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | public interface DisposableFirebirdEmbeddedLibrary extends FirebirdEmbeddedLibrary { 15 | 16 | /** 17 | * Will be called by the native resource tracker (if enabled) on exit of the JVM. 18 | *

19 | * Implementations that need to delete files from the file system should take into account the possibility that 20 | * files cannot be deleted on exit, and should try to apply a strategy to cleanup old files on the next run. 21 | *

22 | */ 23 | void dispose(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/embedded/spi/FirebirdEmbeddedLibrary.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2020-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jna.embedded.spi; 4 | 5 | import java.nio.file.Path; 6 | 7 | /** 8 | * Identifies a Firebird Embedded library that Jaybird can use. 9 | *

10 | * It is recommend to implement {@link DisposableFirebirdEmbeddedLibrary} for implementations that require additional 11 | * cleanup on exit. 12 | *

13 | * 14 | * @author Mark Rotteveel 15 | * @since 5 16 | */ 17 | public interface FirebirdEmbeddedLibrary { 18 | 19 | /** 20 | * @return Path of the Firebird Embedded main library file 21 | */ 22 | Path getEntryPointPath(); 23 | 24 | /** 25 | * Version of the Firebird Embedded library. 26 | * 27 | * @return Version of the Firebird Embedded library 28 | * @see FirebirdEmbeddedLibrary#getVersion() 29 | */ 30 | String getVersion(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/embedded/spi/FirebirdEmbeddedLoadingException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2020-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jna.embedded.spi; 4 | 5 | /** 6 | * Exception to signal errors when loading or identifying a Firebird Embedded library. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | public class FirebirdEmbeddedLoadingException extends Exception { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | public FirebirdEmbeddedLoadingException(String message) { 16 | super(message); 17 | } 18 | 19 | public FirebirdEmbeddedLoadingException(String message, Throwable cause) { 20 | super(message, cause); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/embedded/spi/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2020-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Defines a service provider interface to obtain Firebird Embedded library files from the class path. 5 | *

6 | * See also {@link org.firebirdsql.jna.embedded.spi.FirebirdEmbeddedProvider}. 7 | *

8 | *

9 | * This feature is defined in jdp-2020-05: 10 | * Firebird Embedded locator service provider. 11 | *

12 | * 13 | * @author Mark Rotteveel 14 | * @since 5 15 | */ 16 | package org.firebirdsql.jna.embedded.spi; -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/fbclient/ISC_STATUS.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jna.fbclient; 4 | 5 | import com.sun.jna.IntegerType; 6 | import com.sun.jna.Native; 7 | 8 | import java.io.Serial; 9 | 10 | /** 11 | * JNA wrapper for ISC_STATUS. Size depends on pointer size of the target platform. 12 | * 13 | * @author Mark Rotteveel 14 | */ 15 | @SuppressWarnings({ "unused", "java:S101" }) 16 | public class ISC_STATUS extends IntegerType { 17 | 18 | /** Size of an ISC_STATUS, in bytes. */ 19 | public static final int SIZE = Native.POINTER_SIZE; 20 | 21 | @Serial 22 | private static final long serialVersionUID = 5394203292501996292L; 23 | 24 | /** Create a zero-valued ISC_STATUS. */ 25 | public ISC_STATUS() { 26 | this(0); 27 | } 28 | 29 | /** Create an ISC_STATUS with the given value. */ 30 | public ISC_STATUS(long value) { 31 | super(SIZE, value); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /jaybird-native/src/main/java/org/firebirdsql/jna/fbclient/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Mappings of fbclient API for use with JNA (Java Native Access). 5 | * 6 | * @since 3 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.jna.fbclient; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /jaybird-native/src/main/resources/META-INF/services/org.firebirdsql.gds.impl.GDSFactoryPlugin: -------------------------------------------------------------------------------- 1 | org.firebirdsql.gds.impl.jni.NativeGDSFactoryPlugin 2 | org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin 3 | -------------------------------------------------------------------------------- /jaybird-native/src/main/resources/META-INF/services/org.firebirdsql.jaybird.props.spi.ConnectionPropertyDefinerSpi: -------------------------------------------------------------------------------- 1 | org.firebirdsql.gds.ng.jna.NativeConnectionPropertyDefiner 2 | -------------------------------------------------------------------------------- /src/docs/theme/fonts/NotoSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/jaybird/809106994fee255586da59e1c5d6f59916ca825d/src/docs/theme/fonts/NotoSans-Bold.ttf -------------------------------------------------------------------------------- /src/docs/theme/fonts/NotoSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/jaybird/809106994fee255586da59e1c5d6f59916ca825d/src/docs/theme/fonts/NotoSans-BoldItalic.ttf -------------------------------------------------------------------------------- /src/docs/theme/fonts/NotoSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/jaybird/809106994fee255586da59e1c5d6f59916ca825d/src/docs/theme/fonts/NotoSans-Italic.ttf -------------------------------------------------------------------------------- /src/docs/theme/fonts/NotoSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirebirdSQL/jaybird/809106994fee255586da59e1c5d6f59916ca825d/src/docs/theme/fonts/NotoSans-Regular.ttf -------------------------------------------------------------------------------- /src/extern/org/firebirdsql/extern/decimal/DecimalOverflowException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyright: Copyright 2018 Firebird development team and individual contributors 2 | // SPDX-FileContributor: Mark Rotteveel 3 | // SPDX-License-Identifier: MIT 4 | package org.firebirdsql.extern.decimal; 5 | 6 | /** 7 | * Exception thrown to indicate a coefficient or exponent overflow or underflow. 8 | * 9 | * @author Mark Rotteveel 10 | */ 11 | public final class DecimalOverflowException extends ArithmeticException { 12 | 13 | public DecimalOverflowException(String message) { 14 | super(message); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/extern/org/firebirdsql/extern/decimal/Signum.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyright: Copyright 2018 Firebird development team and individual contributors 2 | // SPDX-FileContributor: Mark Rotteveel 3 | // SPDX-License-Identifier: MIT 4 | package org.firebirdsql.extern.decimal; 5 | 6 | /** 7 | * Signum constants used in decimal-java 8 | * 9 | * @author Mark Rotteveel 10 | */ 11 | public final class Signum { 12 | 13 | public static final int POSITIVE = 1; 14 | public static final int NEGATIVE = -1; 15 | 16 | private Signum() { 17 | // no instances 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/extern/org/firebirdsql/extern/decimal/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyright: Copyright 2018 Firebird development team and individual contributors 2 | // SPDX-FileContributor: Mark Rotteveel 3 | // SPDX-License-Identifier: MIT 4 | /** 5 | * Converts {@link java.math.BigDecimal} to and from IEEE-754r (IEEE-754-2008) decimal byte representations. 6 | *

7 | * This package is a copy from the decimal-java project. 8 | *

9 | */ 10 | @InternalApi 11 | package org.firebirdsql.extern.decimal; 12 | 13 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/ds/RootCommonDataSource.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2011-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.ds; 4 | 5 | import java.io.PrintWriter; 6 | import java.sql.SQLException; 7 | import java.sql.SQLFeatureNotSupportedException; 8 | import java.util.logging.Logger; 9 | 10 | import javax.sql.CommonDataSource; 11 | 12 | import org.firebirdsql.jdbc.FBDriverNotCapableException; 13 | 14 | /** 15 | * Root superclass for the datasources in Firebird. 16 | * 17 | * @author Mark Rotteveel 18 | * @since 2.2 19 | */ 20 | public abstract class RootCommonDataSource implements CommonDataSource { 21 | 22 | public PrintWriter getLogWriter() throws SQLException { 23 | // Unused by Jaybird 24 | return null; 25 | } 26 | 27 | public void setLogWriter(PrintWriter out) throws SQLException { 28 | // Unused by Jaybird 29 | } 30 | 31 | public Logger getParentLogger() throws SQLFeatureNotSupportedException { 32 | throw new FBDriverNotCapableException("Method getParentLogger() not supported"); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/ds/XAConnectionHandler.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2011-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.ds; 4 | 5 | import java.sql.Connection; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * InvocationHandler for the logical connection returned by FBXAConnection. 10 | * 11 | * @author Mark Rotteveel 12 | * @since 2.2 13 | */ 14 | final class XAConnectionHandler extends PooledConnectionHandler { 15 | 16 | private final FBXAConnection xaOwner; 17 | 18 | XAConnectionHandler(Connection connection, FBXAConnection owner) { 19 | super(connection, owner); 20 | xaOwner = owner; 21 | } 22 | 23 | @Override 24 | boolean isRollbackAllowed() throws SQLException { 25 | return !(xaOwner.inDistributedTransaction() || connection.getAutoCommit()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/ds/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementations of {@link javax.sql.DataSource}, {@link javax.sql.XADataSource}, 5 | * {@link javax.sql.ConnectionPoolDataSource} and related classes. 6 | * 7 | * @since 2.2 8 | */ 9 | package org.firebirdsql.ds; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/encodings/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Defines the supported Firebird character sets and their mapping to Java character sets. 5 | *

6 | * It is possible — but considered internal API — to define and override encodings by providing 7 | * an implementation of the {@link org.firebirdsql.encodings.EncodingSet} SPI. See that class for details. 8 | *

9 | * 10 | * @since 3 11 | */ 12 | @InternalApi 13 | package org.firebirdsql.encodings; 14 | 15 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/event/DatabaseEvent.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Gabriel Reid 2 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | package org.firebirdsql.event; 5 | 6 | /** 7 | * An interface for retrieving information about events that have occurred 8 | * 9 | * @author Gabriel Reid 10 | */ 11 | public interface DatabaseEvent { 12 | 13 | /** 14 | * Get the name of the event that occurred. 15 | * 16 | * @return The event name 17 | */ 18 | String getEventName(); 19 | 20 | /** 21 | * Get the number of times the event occurred. 22 | * 23 | * @return The number of times the event occurred 24 | */ 25 | int getEventCount(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/event/DatabaseEventImpl.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Gabriel Reid 2 | // SPDX-FileCopyrightText: Copyright 2013-2023 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | package org.firebirdsql.event; 5 | 6 | record DatabaseEventImpl(String name, int count) implements DatabaseEvent { 7 | 8 | @Override 9 | public int getEventCount() { 10 | return count(); 11 | } 12 | 13 | @Override 14 | public String getEventName() { 15 | return name(); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/event/EventListener.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Gabriel Reid 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.event; 4 | 5 | /** 6 | * An interface for callbacks in response to Firebird events 7 | * 8 | * @author Gabriel Reid 9 | */ 10 | public interface EventListener { 11 | 12 | /** 13 | * Called when a database event occurs. 14 | * 15 | * @param event Object with information about the event that has occurred 16 | */ 17 | void eventOccurred(DatabaseEvent event); 18 | 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/event/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Provides support for listening to Firebird events. 5 | */ 6 | package org.firebirdsql.event; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/BatchParameterBuffer.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds; 4 | 5 | /** 6 | * Represents a batch parameter buffer, for Firebird 4 and higher batch configuration. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | public interface BatchParameterBuffer extends ParameterBuffer { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ConnectionParameterBuffer.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds; 4 | 5 | import org.firebirdsql.encodings.Encoding; 6 | 7 | /** 8 | * @author Mark Rotteveel 9 | */ 10 | public interface ConnectionParameterBuffer extends ParameterBuffer { 11 | 12 | /** 13 | * @return The tag mapping. 14 | */ 15 | ParameterTagMapping getTagMapping(); 16 | 17 | /** 18 | * @return The default encoding of string properties in this parameter buffer. 19 | */ 20 | Encoding getDefaultEncoding(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/DatabaseParameterBuffer.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2003 Ryan Baldwin 2 | // SPDX-FileCopyrightText: Copyright 2003-2008 Roman Rokytskyy 3 | // SPDX-FileCopyrightText: Copyright 2014-2023 Mark Rotteveel 4 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 5 | package org.firebirdsql.gds; 6 | 7 | /** 8 | * Instance of this interface represents a Database Parameter Buffer from the 9 | * Firebird API documentation and specifies the attributes for the 10 | * current connection. 11 | *

12 | * Additionally, it is possible to change some database properties in a permanent 13 | * way, however this approach is not recommended. Please use instead management 14 | * API. 15 | */ 16 | public interface DatabaseParameterBuffer extends ConnectionParameterBuffer { 17 | 18 | /** 19 | * Make a deep copy of this object. 20 | * 21 | * @return deep copy of this object. 22 | */ 23 | DatabaseParameterBuffer deepCopy(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/EventHandle.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Gabriel Reid 2 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 4 | package org.firebirdsql.gds; 5 | 6 | /** 7 | * Handle to internal event-handling structures. 8 | */ 9 | public interface EventHandle { 10 | 11 | /** 12 | * Get the name of the event for which this handle is set to listen for 13 | * 14 | * @return The name of the event 15 | */ 16 | String getEventName(); 17 | 18 | /** 19 | * Get the count of event occurrences for the most recent occurrence(s) 20 | * of the event for which this handle is registered. 21 | * 22 | * @return The event count 23 | */ 24 | int getEventCount(); 25 | 26 | /** 27 | * Get the internal event id number for this handle 28 | * 29 | * @return The internal event id 30 | */ 31 | int getEventId(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/EventHandler.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Gabriel Reid 2 | // SPDX-FileCopyrightText: Copyright 2015-2017 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 4 | package org.firebirdsql.gds; 5 | 6 | /** 7 | * A callback handler interface for event handling. 8 | */ 9 | public interface EventHandler { 10 | 11 | /** 12 | * Called when a database event occurs. 13 | *

14 | * Implementations should take care to only perform short processing on the current thread. If longer or 15 | * complicated processing is necessary, please offload it to another thread or executor. 16 | *

17 | * 18 | * @param eventHandle 19 | * The event handle 20 | */ 21 | void eventOccurred(EventHandle eventHandle); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ServiceParameterBuffer.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2003 Ryan Baldwin 2 | // SPDX-FileCopyrightText: Copyright 2004-2005 Roman Rokytskyy 3 | // SPDX-FileCopyrightText: Copyright 2014-2023 Mark Rotteveel 4 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 5 | package org.firebirdsql.gds; 6 | 7 | /** 8 | * Instance of this interface represents a Service Parameter Buffer from the 9 | * Firebird API documentation and specifies the attributes for the Services API 10 | * connection. 11 | */ 12 | public interface ServiceParameterBuffer extends ConnectionParameterBuffer { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/impl/GDSServerVersionException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2011-2023 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 4 | package org.firebirdsql.gds.impl; 5 | 6 | import java.io.Serial; 7 | import java.sql.SQLNonTransientException; 8 | 9 | /** 10 | * Exception is thrown when server returns a version string in a format that this driver does not understand. 11 | */ 12 | public class GDSServerVersionException extends SQLNonTransientException { 13 | 14 | @Serial 15 | private static final long serialVersionUID = -7437228877120690612L; 16 | 17 | public GDSServerVersionException(String message) { 18 | super(message + "; Expected engine version format: " + 19 | "-...[-] "); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/impl/argument/TypedArgument.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.impl.argument; 4 | 5 | import java.io.Serial; 6 | 7 | /** 8 | * Argument with an argument type. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 5 12 | */ 13 | public abstract class TypedArgument extends Argument { 14 | 15 | @Serial 16 | private static final long serialVersionUID = -6422646924006860740L; 17 | 18 | final ArgumentType argumentType; 19 | 20 | TypedArgument(int type, ArgumentType argumentType) { 21 | super(type); 22 | this.argumentType = argumentType; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/impl/argument/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Arguments (code, type information and value) for {@link org.firebirdsql.gds.impl.ParameterBufferBase}. 5 | */ 6 | @InternalApi 7 | package org.firebirdsql.gds.impl.argument; 8 | 9 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/impl/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * This package contains classes for the pluggable GDS implementations. 5 | */ 6 | @InternalApi 7 | package org.firebirdsql.gds.impl; 8 | 9 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/impl/wire/EncryptedStreamSupport.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.impl.wire; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | import javax.crypto.Cipher; 8 | import java.io.IOException; 9 | 10 | /** 11 | * Interface to support enabling encryption on a stream. 12 | * 13 | * @author Mark Rotteveel 14 | * @since 4.0 15 | */ 16 | @InternalApi 17 | interface EncryptedStreamSupport { 18 | 19 | /** 20 | * Wraps the underlying stream for encryption using the provided {@code cipher}. 21 | *

22 | * An implementation wrapping a stream that also implements {@code EncryptedStreamSupport} may delegate this call to 23 | * that wrapped stream. 24 | *

25 | * 26 | * @param cipher 27 | * Cipher for the stream 28 | * @throws IOException 29 | * If the underlying stream is already wrapped 30 | */ 31 | void setCipher(Cipher cipher) throws IOException; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/impl/wire/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Pure-java implementation of {@link org.firebirdsql.gds.impl.GDSFactoryPlugin} and supporting classes. 5 | */ 6 | @InternalApi 7 | package org.firebirdsql.gds.impl.wire; 8 | 9 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/CursorFlag.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng; 4 | 5 | /** 6 | * Cursor flags. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | public enum CursorFlag { 12 | 13 | CURSOR_TYPE_SCROLLABLE(0x1), 14 | ; 15 | 16 | private final int flagValue; 17 | 18 | CursorFlag(int flagValue) { 19 | this.flagValue = flagValue; 20 | } 21 | 22 | public int flagValue() { 23 | return flagValue; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/FetchDirection.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng; 4 | 5 | /** 6 | * Direction of fetch. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | public enum FetchDirection { 12 | 13 | /** 14 | * Fetch forward (to end of cursor). 15 | */ 16 | FORWARD, 17 | /** 18 | * Fetch reverse (to start of cursor). 19 | */ 20 | REVERSE, 21 | /** 22 | * Fetch in place (doesn't change position). 23 | */ 24 | IN_PLACE, 25 | /** 26 | * Fetch direction unknown (e.g. fetch FIRST or LAST). 27 | */ 28 | UNKNOWN 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/IConnectionProperties.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng; 4 | 5 | import org.firebirdsql.jaybird.props.DatabaseConnectionProperties; 6 | 7 | /** 8 | * Connection properties for the Firebird connection. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0 12 | */ 13 | public interface IConnectionProperties extends IAttachProperties, DatabaseConnectionProperties { 14 | 15 | /** 16 | * @return An immutable version of this instance as an implementation of {@link IConnectionProperties} 17 | */ 18 | @Override 19 | IConnectionProperties asImmutable(); 20 | 21 | /** 22 | * @return A new, mutable, instance as an implementation of {@link IConnectionProperties} with all properties 23 | * copied. 24 | */ 25 | @Override 26 | IConnectionProperties asNewMutable(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/IServiceProperties.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng; 4 | 5 | import org.firebirdsql.jaybird.props.ServiceConnectionProperties; 6 | 7 | /** 8 | * Connection properties for a Firebird service attachment. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0 12 | */ 13 | public interface IServiceProperties extends IAttachProperties, ServiceConnectionProperties { 14 | 15 | /** 16 | * @return An immutable version of this instance as an implementation of {@link IServiceProperties} 17 | */ 18 | @Override 19 | IServiceProperties asImmutable(); 20 | 21 | /** 22 | * @return A new, mutable, instance as an implementation of {@link IServiceProperties} with all properties copied. 23 | */ 24 | @Override 25 | IServiceProperties asNewMutable(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/LockCloseable.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng; 4 | 5 | /** 6 | * Unlocks the lock on {@link #close()}, intended for use with try-with-resources. 7 | *

8 | * Implementations do not guard against multiple invocations of {@code close()}. That means, each call to {@code close} 9 | * will result in an {@link java.util.concurrent.locks.Lock#unlock()} or equivalent. 10 | *

11 | * 12 | * @author Mark Rotteveel 13 | * @since 5 14 | */ 15 | @FunctionalInterface 16 | public interface LockCloseable extends AutoCloseable { 17 | 18 | /** 19 | * Lock closeable that can be used as a no-op (e.g. if there is no lock, and thus nothing to unlock). 20 | */ 21 | LockCloseable NO_OP = () -> { }; 22 | 23 | /** 24 | * Performs an {@link java.util.concurrent.locks.Lock#unlock()} or equivalent on the lock. 25 | */ 26 | @Override 27 | void close(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/OperationCloseHandle.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng; 4 | 5 | /** 6 | * Close handle for {@link org.firebirdsql.gds.ng.monitor.Operation} implementations. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 4.0 10 | */ 11 | public interface OperationCloseHandle extends AutoCloseable { 12 | 13 | @Override 14 | void close(); 15 | 16 | /** 17 | * @return {@code true} if the operation was cancelled 18 | */ 19 | boolean isCancelled(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/WarningMessageCallback.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng; 4 | 5 | import java.sql.SQLWarning; 6 | 7 | /** 8 | * Callback interface for passing warnings. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0 12 | */ 13 | public interface WarningMessageCallback { 14 | 15 | /** 16 | * Signals the warning to the callback 17 | * 18 | * @param warning 19 | * Warning of type SQLWarning 20 | */ 21 | void processWarning(SQLWarning warning); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/dbcrypt/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * SPI for Firebird database encryption callback. 5 | *

6 | * NOTE: This SPI is currently only internal to Jaybird, consider the API as unstable. 7 | *

8 | * 9 | * @since 3.0.4 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.dbcrypt; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/dbcrypt/simple/StaticValueDbCryptCallback.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.dbcrypt.simple; 4 | 5 | import org.firebirdsql.gds.ng.dbcrypt.DbCryptCallback; 6 | import org.firebirdsql.gds.ng.dbcrypt.DbCryptData; 7 | 8 | /** 9 | * Simple database encryption callback, provides a static value response to the callback 10 | * 11 | * @author Mark Rotteveel 12 | * @since 3.0.4 13 | */ 14 | public final class StaticValueDbCryptCallback implements DbCryptCallback { 15 | 16 | static final StaticValueDbCryptCallback EMPTY_RESPONSE = new StaticValueDbCryptCallback(null); 17 | 18 | private final byte[] staticValue; 19 | 20 | StaticValueDbCryptCallback(byte[] staticValue) { 21 | this.staticValue = staticValue; 22 | } 23 | 24 | @Override 25 | public String getDbCryptCallbackName() { 26 | return StaticValueDbCryptCallbackSpi.NAME; 27 | } 28 | 29 | @Override 30 | public DbCryptData handleCallback(DbCryptData serverData) { 31 | return DbCryptData.createReply(staticValue); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/dbcrypt/simple/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.dbcrypt} for static responses. 5 | *

6 | * See Database encryption support 7 | * in the Jaybird manual for usage information. 8 | *

9 | * 10 | * @since 3.0.4 11 | */ 12 | @InternalApi 13 | package org.firebirdsql.gds.ng.dbcrypt.simple; 14 | 15 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/fields/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Low-level field (column or parameter) descriptors, row descriptors, and row values. 5 | * 6 | * @since 3 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.gds.ng.fields; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/listeners/ExceptionListenable.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.listeners; 4 | 5 | /** 6 | * Provides notification of exceptions to {@link ExceptionListener} instance. 7 | *

8 | * Implementations are required to use {@code WeakReference} to hold the listener. It is strongly suggested to use 9 | * {@link ExceptionListenerDispatcher} in your implementation. 10 | *

11 | * 12 | * @author Mark Rotteveel 13 | * @since 3.0 14 | */ 15 | public interface ExceptionListenable { 16 | 17 | /** 18 | * Adds an exception listener to this object. 19 | *

20 | * Implementations use {@code WeakReference}. 21 | *

22 | * 23 | * @param listener 24 | * Listener to register 25 | */ 26 | void addExceptionListener(ExceptionListener listener); 27 | 28 | /** 29 | * Removes an exception listener to this object. 30 | * 31 | * @param listener 32 | * Listener to remove 33 | */ 34 | void removeExceptionListener(ExceptionListener listener); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/listeners/TransactionListener.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.listeners; 4 | 5 | import org.firebirdsql.gds.ng.FbTransaction; 6 | import org.firebirdsql.gds.ng.TransactionState; 7 | 8 | /** 9 | * @author Mark Rotteveel 10 | * @since 3.0 11 | */ 12 | public interface TransactionListener { 13 | 14 | /** 15 | * Signals that the transaction state changed. 16 | * 17 | * @param transaction {@link org.firebirdsql.gds.ng.FbTransaction} that changed state 18 | */ 19 | void transactionStateChanged(FbTransaction transaction, TransactionState newState, TransactionState previousState); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/listeners/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Listener interfaces and supporting classes for the {@link org.firebirdsql.gds.ng} API. 5 | * 6 | * @since 3 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.gds.ng.listeners; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/monitor/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Interfaces for operation monitoring (experimental feature). 5 | * 6 | * @since 4 7 | */ 8 | package org.firebirdsql.gds.ng.monitor; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/tz/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Mapping between Firebird and Java time zones and supporting classes. 5 | * 6 | * @since 4 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.gds.ng.tz; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/BatchCompletionResponse.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.firebirdsql.gds.ng.BatchCompletion; 6 | 7 | /** 8 | * Data from the {@link org.firebirdsql.gds.impl.wire.WireProtocolConstants#op_batch_cs} response. 9 | * 10 | * @param batchCompletion 11 | * batch completion information 12 | * @author Mark Rotteveel 13 | * @since 5 14 | */ 15 | public record BatchCompletionResponse(BatchCompletion batchCompletion) implements Response { 16 | } 17 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/FbWireBlob.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.firebirdsql.gds.ng.FbBlob; 6 | 7 | /** 8 | * @author Mark Rotteveel 9 | * @since 3.0 10 | */ 11 | public interface FbWireBlob extends FbBlob { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/FbWireService.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.firebirdsql.gds.ng.FbService; 6 | 7 | /** 8 | * @author Mark Rotteveel 9 | * @since 3.0 10 | */ 11 | public interface FbWireService extends FbService, FbWireAttachment { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/FbWireStatement.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.firebirdsql.gds.ng.FbStatement; 6 | 7 | /** 8 | * Interface for Statements created for the wire protocol implementation. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0 12 | */ 13 | public interface FbWireStatement extends FbStatement { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/FbWireTransaction.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.firebirdsql.gds.ng.FbTransaction; 6 | 7 | /** 8 | * Interface for transactions created for the wire protocol implementation. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0 12 | */ 13 | public interface FbWireTransaction extends FbTransaction { 14 | } 15 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/FetchResponse.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.firebirdsql.gds.ISCConstants; 6 | 7 | /** 8 | * @param status 9 | * fetch status ({@link ISCConstants#FETCH_OK} or {@link ISCConstants#FETCH_NO_MORE_ROWS} 10 | * @param count 11 | * number of rows following (in practice, either {@code 0} or {@code 1}) 12 | * @author Mark Rotteveel 13 | * @since 3.0 14 | */ 15 | public record FetchResponse(int status, int count) implements Response { 16 | } 17 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/GenericResponse.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * @param objectHandle 9 | * object handle associated with the response 10 | * @param blobId 11 | * blob id or status value 12 | * @param data 13 | * data 14 | * @param exception 15 | * exception or warning (or {@code null} for no exception or warning) 16 | * @author Mark Rotteveel 17 | * @since 3.0 18 | */ 19 | @SuppressWarnings("java:S6218") 20 | public record GenericResponse(int objectHandle, long blobId, byte[] data, SQLException exception) implements Response { 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/InlineBlobResponse.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | import org.jspecify.annotations.NullMarked; 6 | 7 | /** 8 | * Response instance for an inline blob ({@code op_inline_blob}) response. 9 | * 10 | * @param transactionHandle 11 | * transaction handle the inline blob is valid for 12 | * @param blobId 13 | * blob id 14 | * @param info 15 | * byte array with blob info 16 | * @param data 17 | * byte array with blob data (without segments) 18 | * @author Mark Rotteveel 19 | * @since 7 20 | */ 21 | @NullMarked 22 | public record InlineBlobResponse(int transactionHandle, long blobId, byte[] info, byte[] data) implements Response { 23 | 24 | public InlineBlob toInlineBlob(FbWireDatabase database) { 25 | return new InlineBlob(database, blobId, transactionHandle, info, data); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/Response.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | /** 6 | * @author Mark Rotteveel 7 | * @since 3.0 8 | */ 9 | public interface Response { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/SqlResponse.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2013-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire; 4 | 5 | /** 6 | * @param count 7 | * number of rows following (either {@code 0} or {@code 1}) 8 | * @author Mark Rotteveel 9 | * @since 3.0 10 | */ 11 | public record SqlResponse(int count) implements Response { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/AuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire.auth; 4 | 5 | /** 6 | * Service provider interface for authentication plugins. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 3.0 10 | */ 11 | public interface AuthenticationPluginSpi { 12 | 13 | /** 14 | * @return Name of the plugin as used by Firebird 15 | */ 16 | String getPluginName(); 17 | 18 | /** 19 | * @return Plugin instance 20 | */ 21 | AuthenticationPlugin createPlugin(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/legacy/LegacyAuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.auth.legacy; 4 | 5 | import org.firebirdsql.gds.ng.wire.auth.AuthenticationPlugin; 6 | import org.firebirdsql.gds.ng.wire.auth.AuthenticationPluginSpi; 7 | 8 | /** 9 | * Legacy authentication plugin service provider. 10 | * 11 | * @author Mark Rotteveel 12 | */ 13 | public class LegacyAuthenticationPluginSpi implements AuthenticationPluginSpi { 14 | 15 | public static final String LEGACY_AUTH_NAME = "Legacy_Auth"; 16 | 17 | @Override 18 | public String getPluginName() { 19 | return LEGACY_AUTH_NAME; 20 | } 21 | 22 | @Override 23 | public AuthenticationPlugin createPlugin() { 24 | return new LegacyAuthenticationPlugin(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/legacy/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire.auth} for the {@code Legacy_Auth} authentication plugin. 5 | *

6 | * Also used for Firebird 2.5 and earlier authentication. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.auth.legacy; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * SPI for Firebird authentication plugins for the wire protocol implementation. 5 | * 6 | * @since 3 7 | */ 8 | package org.firebirdsql.gds.ng.wire.auth; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/srp/Srp224AuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.auth.srp; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * Srp224 authentication plugin service provider. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 4.0 12 | */ 13 | public class Srp224AuthenticationPluginSpi extends AbstractSrpAuthenticationPluginSpi { 14 | 15 | public static final String SRP_224_AUTH_NAME = "Srp224"; 16 | 17 | public Srp224AuthenticationPluginSpi() throws SQLException { 18 | super(SRP_224_AUTH_NAME, "SHA-224"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/srp/Srp256AuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.auth.srp; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * Srp256 authentication plugin service provider. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0.5 12 | */ 13 | public class Srp256AuthenticationPluginSpi extends AbstractSrpAuthenticationPluginSpi { 14 | 15 | public static final String SRP_256_AUTH_NAME = "Srp256"; 16 | 17 | public Srp256AuthenticationPluginSpi() throws SQLException { 18 | super(SRP_256_AUTH_NAME, "SHA-256"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/srp/Srp384AuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.auth.srp; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * Srp384 authentication plugin service provider. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 4.0 12 | */ 13 | public class Srp384AuthenticationPluginSpi extends AbstractSrpAuthenticationPluginSpi { 14 | 15 | public static final String SRP_384_AUTH_NAME = "Srp384"; 16 | 17 | public Srp384AuthenticationPluginSpi() throws SQLException { 18 | super(SRP_384_AUTH_NAME, "SHA-384"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/srp/Srp512AuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.auth.srp; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * Srp512 authentication plugin service provider. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 4.0 12 | */ 13 | public class Srp512AuthenticationPluginSpi extends AbstractSrpAuthenticationPluginSpi { 14 | 15 | public static final String SRP_512_AUTH_NAME = "Srp512"; 16 | 17 | public Srp512AuthenticationPluginSpi() throws SQLException { 18 | super(SRP_512_AUTH_NAME, "SHA-512"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/srp/SrpAuthenticationPluginSpi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.auth.srp; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * Srp (Srp using SHA-1) authentication plugin service provider. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 3.0 12 | */ 13 | public class SrpAuthenticationPluginSpi extends AbstractSrpAuthenticationPluginSpi { 14 | 15 | public static final String SRP_AUTH_NAME = "Srp"; 16 | 17 | public SrpAuthenticationPluginSpi() throws SQLException { 18 | super(SRP_AUTH_NAME, "SHA-1"); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/auth/srp/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire.auth} for the {@code Srp} family of authentication plugin. 5 | * 6 | * @since 3 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.gds.ng.wire.auth.srp; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/crypt/CryptConnectionInfo.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire.crypt; 4 | 5 | /** 6 | * Details of the connection, which the SPI can use to decide if they can work. 7 | *

8 | * NOTE: This class is currently only internal to Jaybird, consider the API as unstable. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 6 13 | */ 14 | public interface CryptConnectionInfo { 15 | 16 | /** 17 | * Protocol version of the connection. 18 | *

19 | * The protocol version is masked, so use the relevant {@code PROTOCOL_VERSIONnn} constants from 20 | * {@link org.firebirdsql.gds.impl.wire.WireProtocolConstants} or equivalents for checks. 21 | *

22 | * 23 | * @return protocol version, {@code 0} means unknown (shouldn't occur normally) 24 | */ 25 | int protocolVersion(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/crypt/EncryptionPlugin.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2017-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.gds.ng.wire.crypt; 4 | 5 | /** 6 | * Plugin for Firebird wire encryption. 7 | *

8 | * NOTE: This plugin is currently only internal to Jaybird, consider the API as unstable. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 4.0 13 | */ 14 | public interface EncryptionPlugin { 15 | 16 | /** 17 | * @return Encryption identifier 18 | */ 19 | EncryptionIdentifier encryptionIdentifier(); 20 | 21 | /** 22 | * Initializes the encryption for incoming and outgoing communication. 23 | * 24 | * @return Object with the result of initialization 25 | */ 26 | EncryptionInitInfo initializeEncryption(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/crypt/FBSQLEncryptException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2017 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.crypt; 4 | 5 | import java.sql.SQLInvalidAuthorizationSpecException; 6 | 7 | /** 8 | * Exception that indicates encryption could not be initialized. 9 | *

10 | * This exception is thrown when wire encryption cannot be initialized, for example if the current authentication 11 | * plugin does not support generating a session key, or if no matching cipher can be found. 12 | *

13 | * 14 | * @author Mark Rotteveel 15 | * @since 4.0 16 | */ 17 | public class FBSQLEncryptException extends SQLInvalidAuthorizationSpecException { 18 | 19 | public FBSQLEncryptException(String reason, String sqlState, int vendorCode) { 20 | super(reason, sqlState, vendorCode); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/crypt/arc4/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire.crypt} for {@code Arc4}. 5 | * 6 | * @since 4 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.gds.ng.wire.crypt.arc4; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/crypt/chacha/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire.crypt} for {@code ChaCha} (not {@code ChaCha64}). 5 | * 6 | * @since 5 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.gds.ng.wire.crypt.chacha; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/crypt/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * SPI for Firebird wire protocol encryption plugins for the wire protocol implementation, and supporting classes. 5 | *

6 | * NOTE: This SPI is currently only internal to Jaybird, consider the API as unstable. 7 | *

8 | * 9 | * @since 4 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.crypt; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Pure-java implementation of the {@link org.firebirdsql.gds.ng} API for the Firebird wire protocol. 5 | *

6 | * Concrete implementations of the wire protocol are defined in packages {@link org.firebirdsql.gds.ng.wire.version10}, 7 | * etc. 8 | *

9 | * 10 | * @since 3.0 11 | */ 12 | @InternalApi 13 | package org.firebirdsql.gds.ng.wire; 14 | 15 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version10/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 10 of the Firebird wire protocol. 5 | *

6 | * Version 10 is the wire protocol version supported by Firebird 1.0 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version10; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version11/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 11 of the Firebird wire protocol. 5 | *

6 | * Version 11 is the wire protocol version supported by Firebird 2.1 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version11; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version12/V12Statement.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.gds.ng.wire.FbWireDatabase; 6 | import org.firebirdsql.gds.ng.wire.version11.V11Statement; 7 | 8 | /** 9 | * @author Mark Rotteveel 10 | */ 11 | public class V12Statement extends V11Statement { 12 | 13 | /** 14 | * Creates a new instance of V12Statement for the specified database. 15 | * 16 | * @param database 17 | * FbWireDatabase implementation 18 | */ 19 | public V12Statement(FbWireDatabase database) { 20 | super(database); 21 | } 22 | 23 | @Override 24 | public int getMaxSqlInfoSize() { 25 | // Theoretically, also protocol 11 (Firebird 2.1), but not supported since before Jaybird 5 26 | return 65535; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version12/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 12 of the Firebird wire protocol. 5 | *

6 | * Version 12 is the wire protocol version supported by Firebird 2.5 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version12; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version13/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 13 of the Firebird wire protocol. 5 | *

6 | * Version 13 is the wire protocol version supported by Firebird 3.0 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version13; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version15/V15Database.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2021 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.gds.ng.wire.ProtocolDescriptor; 6 | import org.firebirdsql.gds.ng.wire.WireDatabaseConnection; 7 | import org.firebirdsql.gds.ng.wire.version13.V13Database; 8 | 9 | /** 10 | * {@link org.firebirdsql.gds.ng.wire.FbWireDatabase} implementation for the version 15 wire protocol. 11 | * 12 | * @author Mark Rotteveel 13 | * @since 4.0 14 | */ 15 | public class V15Database extends V13Database { 16 | 17 | /** 18 | * Creates a V15Database instance. 19 | * 20 | * @param connection 21 | * A WireConnection with an established connection to the server. 22 | * @param descriptor 23 | * The ProtocolDescriptor that created this connection (this is used for creating further dependent 24 | * objects). 25 | */ 26 | protected V15Database(WireDatabaseConnection connection, 27 | ProtocolDescriptor descriptor) { 28 | super(connection, descriptor); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version15/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 15 of the Firebird wire protocol. 5 | *

6 | * Version 15 is the wire protocol version supported by Firebird 3.0.2 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version15; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version16/V16Database.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2021 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version16; 4 | 5 | import org.firebirdsql.gds.ng.wire.ProtocolDescriptor; 6 | import org.firebirdsql.gds.ng.wire.WireDatabaseConnection; 7 | import org.firebirdsql.gds.ng.wire.version15.V15Database; 8 | 9 | /** 10 | * {@link org.firebirdsql.gds.ng.wire.FbWireDatabase} implementation for the version 16 wire protocol. 11 | * 12 | * @author Mark Rotteveel 13 | * @since 4.0 14 | */ 15 | public class V16Database extends V15Database { 16 | 17 | /** 18 | * Creates a V16Database instance. 19 | * 20 | * @param connection 21 | * A WireConnection with an established connection to the server. 22 | * @param descriptor 23 | * The ProtocolDescriptor that created this connection (this is used for creating further dependent 24 | * objects). 25 | */ 26 | protected V16Database(WireDatabaseConnection connection, 27 | ProtocolDescriptor descriptor) { 28 | super(connection, descriptor); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version16/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 16 of the Firebird wire protocol. 5 | *

6 | * Version 16 is the wire protocol version supported by Firebird 4.0 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version16; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version18/V18Database.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.gds.ng.wire.ProtocolDescriptor; 6 | import org.firebirdsql.gds.ng.wire.WireDatabaseConnection; 7 | import org.firebirdsql.gds.ng.wire.version16.V16Database; 8 | 9 | /** 10 | * {@link org.firebirdsql.gds.ng.wire.FbWireDatabase} implementation for the version 18 wire protocol. 11 | * 12 | * @author Mark Rotteveel 13 | * @since 5 14 | */ 15 | public class V18Database extends V16Database { 16 | 17 | /** 18 | * Creates a V18Database instance. 19 | * 20 | * @param connection 21 | * A WireConnection with an established connection to the server. 22 | * @param descriptor 23 | * The ProtocolDescriptor that created this connection (this is used for creating further dependent 24 | * objects). 25 | */ 26 | protected V18Database(WireDatabaseConnection connection, ProtocolDescriptor descriptor) { 27 | super(connection, descriptor); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version18/V18WireOperations.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.gds.ng.WarningMessageCallback; 6 | import org.firebirdsql.gds.ng.wire.WireConnection; 7 | import org.firebirdsql.gds.ng.wire.version16.V16WireOperations; 8 | 9 | import static org.firebirdsql.gds.impl.wire.WireProtocolConstants.op_batch_sync; 10 | 11 | /** 12 | * @author Mark Rotteveel 13 | * @since 6 14 | */ 15 | public class V18WireOperations extends V16WireOperations { 16 | 17 | public V18WireOperations(WireConnection connection, WarningMessageCallback defaultWarningMessageCallback) { 18 | super(connection, defaultWarningMessageCallback); 19 | } 20 | 21 | @Override 22 | protected int getBatchSyncOperation() { 23 | return op_batch_sync; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version18/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 18 of the Firebird wire protocol. 5 | *

6 | * Version 18 is the wire protocol version supported by Firebird 5.0 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version18; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/ng/wire/version19/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of {@link org.firebirdsql.gds.ng.wire} for version 19 of the Firebird wire protocol. 5 | *

6 | * Version 19 is the wire protocol version supported by Firebird 5.0.3 and higher. 7 | *

8 | * 9 | * @since 3 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.gds.ng.wire.version19; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/gds/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Low-level APIs for accessing a Firebird database server. 5 | *

6 | * This package contains classes defining the Firebird API for Java language that applications can use to access 7 | * databases directly without JDBC interfaces. This is probably most efficient way to access the database, but also it 8 | * is the most complicated one and requires deep knowledge of the Firebird API. For better understanding please refer 9 | * to the "InterBase 6 API Guide" published by Borland and released together with the open-sourcing the InterBase code, 10 | * a predecessor of Firebird. 11 | *

12 | *

13 | * Please refer to the documentation in the javadoc comments as well as to the source code for more information. 14 | *

15 | */ 16 | @InternalApi 17 | package org.firebirdsql.gds; 18 | 19 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/fb/constants/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Constants for Firebird API values. 5 | *

6 | * For historic reasons, a lot of constants are currently defined in {@link org.firebirdsql.gds.ISCConstants} instead 7 | * of here. These may be moved to here in future releases on a case-by-case basis. 8 | *

9 | *

10 | * Constants for the Firebird wire protocol are defined in {@link org.firebirdsql.gds.impl.wire.WireProtocolConstants}. 11 | *

12 | * 13 | * @since 5 14 | */ 15 | @InternalApi 16 | package org.firebirdsql.jaybird.fb.constants; 17 | 18 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Provides version information for the Jaybird library. 5 | *

6 | * This package primarily exists so this library has a package matching its module-name ({@code org.firebirdsql.jaybird}). 7 | *

8 | * 9 | * @since 4 10 | */ 11 | @InternalApi 12 | package org.firebirdsql.jaybird; 13 | 14 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/AbstractSymbolToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Token that is always a single symbol. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | abstract class AbstractSymbolToken implements Token { 12 | 13 | private final int pos; 14 | 15 | AbstractSymbolToken(int pos) { 16 | this.pos = pos; 17 | } 18 | 19 | @Override 20 | public final int position() { 21 | return pos; 22 | } 23 | 24 | @Override 25 | public int length() { 26 | return 1; 27 | } 28 | 29 | @Override 30 | public boolean equals(Object o) { 31 | if (this == o) return true; 32 | if (o == null || getClass() != o.getClass()) return false; 33 | 34 | AbstractSymbolToken that = (AbstractSymbolToken) o; 35 | 36 | return pos == that.pos; 37 | } 38 | 39 | @Override 40 | public int hashCode() { 41 | return pos; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/AbstractTokenVisitor.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Simplified abstraction for token visitors that are not interested in the visitor registrar. 7 | *

8 | * Implementations should override {@link #visitToken(Token)} and/or {@link #complete()}. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | abstract class AbstractTokenVisitor implements TokenVisitor { 15 | 16 | @Override 17 | public final void visitToken(Token token, VisitorRegistrar visitorRegistrar) { 18 | visitToken(token); 19 | } 20 | 21 | protected void visitToken(Token token) { 22 | // do nothing 23 | } 24 | 25 | @Override 26 | public final void complete(VisitorRegistrar visitorRegistrar) { 27 | complete(); 28 | } 29 | 30 | protected void complete() { 31 | // do nothing 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/CloseToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a close token in the token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | interface CloseToken extends Token { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/ColonToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a colon ({@code :}) in the token stream. 7 | *

8 | * Expected occurrence is either as the prefix of a named parameter (e.g. in PSQL), or as the separator between 9 | * array dimensions. 10 | *

11 | * 12 | * @author Mark Rotteveel 13 | * @since 5 14 | */ 15 | final class ColonToken extends AbstractSymbolToken { 16 | 17 | public ColonToken(int position) { 18 | super(position); 19 | } 20 | 21 | @Override 22 | public String text() { 23 | return ":"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/CommaToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a comma ({@code ,}) in a token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | final class CommaToken extends AbstractSymbolToken { 12 | 13 | public CommaToken(int position) { 14 | super(position); 15 | } 16 | 17 | @Override 18 | public String text() { 19 | return ","; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/CommentToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a block (/*...*{@literal /}) or line comment ({@code --...}, excluding 7 | * the linebreak) in a token stream. 8 | * 9 | * @author Mark Rotteveel 10 | * @since 5 11 | */ 12 | final class CommentToken extends AbstractToken { 13 | 14 | CommentToken(int pos, CharSequence src, int start, int end) { 15 | super(pos, src, start, end); 16 | } 17 | 18 | public CommentToken(int pos, CharSequence tokenText) { 19 | super(pos, tokenText); 20 | } 21 | 22 | @Override 23 | public boolean isWhitespaceOrComment() { 24 | return true; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/CurlyBraceClose.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a closing curly brace (}) in the token stream. 7 | *

8 | * This token shouldn't occur in Firebird syntax, but is used in JDBC escapes. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class CurlyBraceClose extends AbstractSymbolToken implements CloseToken { 15 | 16 | public CurlyBraceClose(int position) { 17 | super(position); 18 | } 19 | 20 | @Override 21 | public String text() { 22 | return "}"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/CurlyBraceOpen.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals an opening curly brace ({) in the token stream. 7 | *

8 | * This token shouldn't occur in Firebird syntax, but is used in JDBC escapes. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class CurlyBraceOpen extends AbstractSymbolToken implements OpenToken { 15 | 16 | public CurlyBraceOpen(int position) { 17 | super(position); 18 | } 19 | 20 | @Override 21 | public boolean closedBy(CloseToken closeToken) { 22 | return closeToken instanceof CurlyBraceClose; 23 | } 24 | 25 | @Override 26 | public String text() { 27 | return "{"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/LiteralToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a literal in the token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | interface LiteralToken extends Token { 12 | } 13 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/LocalStatementClass.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | /** 8 | * Class of {@link LocalStatementType}. 9 | *

10 | * The types of this enum are decided by the needs of Jaybird, and do not necessarily cover all statement classes. 11 | *

12 | * 13 | * @author Mark Rotteveel 14 | * @since 6 15 | */ 16 | @InternalApi 17 | public enum LocalStatementClass { 18 | 19 | DML, 20 | TRANSACTION_BOUNDARY, 21 | UNKNOWN 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/NullLiteralToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a null in the token stream. 7 | *

8 | * The literal {@code UNKNOWN} is signalled as a {@link BooleanLiteralToken}. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class NullLiteralToken extends AbstractToken implements LiteralToken { 15 | 16 | NullLiteralToken(int pos, CharSequence src, int start, int end) { 17 | super(pos, src, start, end); 18 | } 19 | 20 | public NullLiteralToken(int pos, CharSequence tokenText) { 21 | super(pos, tokenText); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/OpenToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals an open token in the token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | interface OpenToken extends Token { 12 | 13 | /** 14 | * Is this token closed by the provided close token. 15 | * 16 | * @param closeToken 17 | * Close token 18 | * @return {@code true} if {@code closeToken} closes this token, {@code false} otherwise 19 | */ 20 | boolean closedBy(CloseToken closeToken); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/OperatorToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals an operator in the token stream. 7 | *

8 | * The term operator is taken very broadly, and includes mathematical operators ({@code + - / *}, boolean operators 9 | * ({@code and or is not} and comparison operators ({@code = <> > < >= <= != ~= ^= !< ~< ^< !> ~> ^>} and the prefix of 10 | * those operators ({@code ! ~ ^} if they appear individually in the statement (which is a syntax error in Firebird). 11 | *

12 | * 13 | * @author Mark Rotteveel 14 | * @since 5 15 | */ 16 | final class OperatorToken extends AbstractToken { 17 | 18 | OperatorToken(int pos, CharSequence src, int start, int end) { 19 | super(pos, src, start, end); 20 | } 21 | 22 | public OperatorToken(int pos, CharSequence tokenText) { 23 | super(pos, tokenText); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/ParenthesisClose.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a closing parenthesis ({@code )}) in the token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | final class ParenthesisClose extends AbstractSymbolToken implements CloseToken { 12 | 13 | public ParenthesisClose(int position) { 14 | super(position); 15 | } 16 | 17 | @Override 18 | public String text() { 19 | return ")"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/ParenthesisOpen.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals an opening parenthesis ({@code (}) in the token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | final class ParenthesisOpen extends AbstractSymbolToken implements OpenToken { 12 | 13 | public ParenthesisOpen(int position) { 14 | super(position); 15 | } 16 | 17 | @Override 18 | public boolean closedBy(CloseToken closeToken) { 19 | return closeToken instanceof ParenthesisClose; 20 | } 21 | 22 | @Override 23 | public String text() { 24 | return "("; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/PeriodToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a period ({@code .}) in the token stream. 7 | *

8 | * Expected occurrence is as separator between identifiers (e.g. {@code alias.column} or {@code package.function()}) 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class PeriodToken extends AbstractSymbolToken { 15 | 16 | public PeriodToken(int position) { 17 | super(position); 18 | } 19 | 20 | @Override 21 | public String text() { 22 | return "."; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/PositionalParameterToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a positional parameter ({@code ?}) in the token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | final class PositionalParameterToken extends AbstractSymbolToken { 12 | 13 | public PositionalParameterToken(int position) { 14 | super(position); 15 | } 16 | 17 | @Override 18 | public String text() { 19 | return "?"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/ReservedToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a reserved word in the token stream that is not represented with a more specific token. 7 | *

8 | * Reserved words not represented by this class are (possibly not complete): 9 | *

10 | *
{@code and or not is}
11 | *
represented as {@link OperatorToken}
12 | *
{@code null}
13 | *
represented as {@link NullLiteralToken}
14 | *
{@code true false unknown}
15 | *
represented as {@link BooleanLiteralToken}
16 | *
17 | *

18 | * 19 | * @author Mark Rotteveel 20 | * @since 5 21 | */ 22 | final class ReservedToken extends AbstractToken { 23 | 24 | @SuppressWarnings("unused") 25 | ReservedToken(int pos, CharSequence src, int start, int end) { 26 | super(pos, src, start, end); 27 | } 28 | 29 | public ReservedToken(int pos, CharSequence tokenText) { 30 | super(pos, tokenText); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/ReservedWords.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | /** 8 | * Interface for reserved words checks. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 5 12 | */ 13 | @InternalApi 14 | public interface ReservedWords { 15 | 16 | /** 17 | * Checks case-insensitively if the supplied token text is a reserved word. 18 | * 19 | * @param tokenText 20 | * Token text to check 21 | * @return {@code true} if the token text is a reserved word, {@code false} otherwise 22 | */ 23 | boolean isReservedWord(CharSequence tokenText); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/SemicolonToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a semicolon ({@code ;}) in the token stream. 7 | *

8 | * Expected occurrence is in PSQL bodies, or at the very end of a statement (for syntax flexibility). 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class SemicolonToken extends AbstractSymbolToken { 15 | 16 | public SemicolonToken(int position) { 17 | super(position); 18 | } 19 | 20 | @Override 21 | public String text() { 22 | return ";"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/SquareBracketClose.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals a closing square bracket ({@code ]} in the token stream. 7 | *

8 | * Expected occurrence is in definition of array dimensions or when dereferencing an array element. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class SquareBracketClose extends AbstractSymbolToken implements CloseToken { 15 | 16 | public SquareBracketClose(int position) { 17 | super(position); 18 | } 19 | 20 | @Override 21 | public String text() { 22 | return "]"; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/SquareBracketOpen.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals an opening square bracket ({@code [} in the token stream. 7 | *

8 | * Expected occurrence is in definition of array dimensions or when dereferencing an array element. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 5 13 | */ 14 | final class SquareBracketOpen extends AbstractSymbolToken implements OpenToken { 15 | 16 | public SquareBracketOpen(int position) { 17 | super(position); 18 | } 19 | 20 | @Override 21 | public boolean closedBy(CloseToken closeToken) { 22 | return closeToken instanceof SquareBracketClose; 23 | } 24 | 25 | @Override 26 | public String text() { 27 | return "["; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/TokenVisitor.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | /** 8 | * Visitor for tokens. 9 | *

10 | * Used by {@link SqlParser} to notify the visitors of tokens. 11 | *

12 | * 13 | * @author Mark Rotteveel 14 | * @since 5 15 | */ 16 | @InternalApi 17 | public interface TokenVisitor { 18 | 19 | /** 20 | * Notifies the visitor of a token. 21 | * 22 | * @param token 23 | * Token 24 | * @param visitorRegistrar 25 | * Visitor registrar (can be used to remove itself, or add other visitors) 26 | */ 27 | void visitToken(Token token, VisitorRegistrar visitorRegistrar); 28 | 29 | /** 30 | * Signals that the last token was produced and the statement text was fully parsed. 31 | * 32 | * @param visitorRegistrar 33 | * Visitor registrar (can be used to remove itself, or add other visitors) 34 | */ 35 | void complete(VisitorRegistrar visitorRegistrar); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/UnexpectedEndOfInputException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | /** 8 | * Thrown when the tokenizer required a character, but instead the end of input was reached. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 5 12 | */ 13 | @InternalApi 14 | public class UnexpectedEndOfInputException extends RuntimeException { 15 | 16 | private static final long serialVersionUID = 5393338512797009183L; 17 | 18 | public UnexpectedEndOfInputException(String message) { 19 | super(message); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/VisitorRegistrar.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.firebirdsql.util.InternalApi; 6 | 7 | /** 8 | * Registrar for visitors that allows runtime removal or addition of visitors. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 5 12 | */ 13 | @InternalApi 14 | public interface VisitorRegistrar { 15 | 16 | /** 17 | * Adds a visitor. 18 | * 19 | * @param tokenVisitor 20 | * Token visitor 21 | */ 22 | void addVisitor(TokenVisitor tokenVisitor); 23 | 24 | /** 25 | * Removes a visitor - if already registered. 26 | * 27 | * @param tokenVisitor 28 | * Token visitor 29 | */ 30 | void removeVisitor(TokenVisitor tokenVisitor); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/WhitespaceToken.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | /** 6 | * Signals one or more whitespace characters in a token stream. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 5 10 | */ 11 | final class WhitespaceToken extends AbstractToken { 12 | 13 | WhitespaceToken(int pos, CharSequence src, int start, int end) { 14 | super(pos, src, start, end); 15 | } 16 | 17 | public WhitespaceToken(int pos, CharSequence tokenText) { 18 | super(pos, tokenText); 19 | } 20 | 21 | @Override 22 | public boolean isWhitespaceOrComment() { 23 | return true; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/parser/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Statement parser for generated keys support. 5 | *

6 | * DO NOT USE! This packages is for driver-internal purposes only. 7 | *

8 | *

9 | * The parser in this package is not a full implementation of the Firebird SQL dialect. It only serves to obtain the 10 | * statement information necessary for internal purposes of Jaybird (like generated keys support). 11 | *

12 | */ 13 | @InternalApi 14 | package org.firebirdsql.jaybird.parser; 15 | 16 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/props/def/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Definition of a connection property and supporting classes. 5 | * 6 | * @since 5 7 | */ 8 | package org.firebirdsql.jaybird.props.def; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/props/internal/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Internal API for connection properties and the definition of properties supported by Jaybird. 5 | * 6 | * @since 5 7 | */ 8 | @InternalApi 9 | package org.firebirdsql.jaybird.props.internal; 10 | 11 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/props/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * APIs and constants for connection properties for attachments to a Firebird database or service API. 5 | * 6 | * @since 5 7 | */ 8 | package org.firebirdsql.jaybird.props; 9 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/props/spi/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * SPI to register connection properties with Jaybird. 5 | *

6 | * See {@link org.firebirdsql.jaybird.props.spi.ConnectionPropertyDefinerSpi} for more information. 7 | *

8 | * 9 | * @since 5 10 | */ 11 | package org.firebirdsql.jaybird.props.spi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/util/Cleaners.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.util; 4 | 5 | import java.lang.ref.Cleaner; 6 | 7 | /** 8 | * Factory for {@link Cleaner} for use within Jaybird. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 6 12 | */ 13 | public final class Cleaners { 14 | 15 | private static final Cleaner jbCleaner = Cleaner.create(); 16 | private static final Cleaner.Cleanable NO_OP = () -> {}; 17 | 18 | private Cleaners() { 19 | // no instances 20 | } 21 | 22 | /** 23 | * @return {@link Cleaner} for use within Jaybird 24 | */ 25 | public static Cleaner getJbCleaner() { 26 | return jbCleaner; 27 | } 28 | 29 | /** 30 | * @return A {@link java.lang.ref.Cleaner.Cleanable} which does nothing 31 | */ 32 | public static Cleaner.Cleanable getNoOp() { 33 | return NO_OP; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/util/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Utility classes which are strictly for use within Jaybird itself. 5 | * 6 | * @author Mark Rotteveel 7 | * @since 6 8 | */ 9 | @InternalApi 10 | @NullMarked 11 | package org.firebirdsql.jaybird.util; 12 | 13 | import org.firebirdsql.util.InternalApi; 14 | import org.jspecify.annotations.NullMarked; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/xca/FBIncorrectXidException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2020-2023 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | package org.firebirdsql.jaybird.xca; 5 | 6 | import java.io.Serial; 7 | 8 | /** 9 | * This error is thrown when message read from the RDB$TRANSACTIONS table does not represent a serialized Xid. 10 | */ 11 | public class FBIncorrectXidException extends Exception { 12 | 13 | @Serial 14 | private static final long serialVersionUID = -4422195562607053359L; 15 | 16 | public FBIncorrectXidException(String reason) { 17 | super(reason); 18 | } 19 | 20 | public FBIncorrectXidException(String reason, Throwable cause) { 21 | super(reason, cause); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jaybird/xca/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * XCA (or ex-connector-architecture), is an internal API of Jaybird for connection management. 5 | *

6 | * Historically it was derived from the JavaEE Connector Architecture specification, but that tie has been cut 7 | * since Jaybird 5. 8 | *

9 | *

10 | * All classes, interfaces and other constructs in this package should be considered internal API of Jaybird, and may 11 | * change radically between point releases. Do not use it in your own code. 12 | *

13 | */ 14 | @InternalApi 15 | package org.firebirdsql.jaybird.xca; 16 | 17 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FBDriverNotCapableException.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2003 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2011-2023 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | package org.firebirdsql.jdbc; 5 | 6 | import java.io.Serial; 7 | import java.sql.SQLFeatureNotSupportedException; 8 | 9 | /** 10 | * Tell that driver is not able to serve the request due to missing capabilities. 11 | * 12 | * @author Roman Rokytskyy 13 | */ 14 | public class FBDriverNotCapableException extends SQLFeatureNotSupportedException { 15 | 16 | @Serial 17 | private static final long serialVersionUID = 4813885566272454052L; 18 | 19 | /** 20 | * Create instance of this class for the specified reason. 21 | * 22 | * @param reason reason that will be displayed. 23 | */ 24 | public FBDriverNotCapableException(String reason) { 25 | super(reason, SQLStateConstants.SQL_STATE_FEATURE_NOT_SUPPORTED); 26 | } 27 | 28 | /** 29 | * Create instance of this class. 30 | */ 31 | public FBDriverNotCapableException() { 32 | this("Not yet implemented."); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FirebirdClob.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.jdbc; 4 | 5 | import java.sql.Clob; 6 | 7 | /** 8 | * Firebird Clob abstraction. This interface defines methods to read and write Clob content. 9 | * 10 | * @author Mark Rotteveel 11 | */ 12 | public interface FirebirdClob extends Clob { 13 | /* Empty interface retained for potential future extension */ 14 | } 15 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FirebirdDriver.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2020-2023 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 4 | package org.firebirdsql.jdbc; 5 | 6 | import java.sql.Driver; 7 | 8 | /** 9 | * Extension of {@link java.sql.Driver} for Jaybird. 10 | *

11 | * Currently empty, but retained in case we want to add extensions. 12 | *

13 | */ 14 | public interface FirebirdDriver extends Driver { 15 | } 16 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FirebirdParameterMetaData.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2007 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2011-2012 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 4 | package org.firebirdsql.jdbc; 5 | 6 | import java.sql.ParameterMetaData; 7 | 8 | /** 9 | * Firebird extension to the {@link java.sql.ParameterMetaData} interface. 10 | */ 11 | public interface FirebirdParameterMetaData extends ParameterMetaData { 12 | 13 | } -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FirebirdResultSetMetaData.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2009 Roman Rokytskyy 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.jdbc; 4 | 5 | import java.sql.ResultSetMetaData; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Firebird-specific extensions to the {@link ResultSetMetaData} interface. 10 | * 11 | * @author Roman Rokytskyy 12 | */ 13 | public interface FirebirdResultSetMetaData extends ResultSetMetaData { 14 | 15 | /** 16 | * Gets the designated column's table alias. 17 | * 18 | * @param column the first column is 1, the second is 2, ... 19 | * @return table alias or "" if not applicable 20 | * @exception SQLException if a database access error occurs 21 | */ 22 | String getTableAlias(int column) throws SQLException; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FirebirdRowId.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.jdbc; 4 | 5 | import java.sql.RowId; 6 | 7 | /** 8 | * Firebird-specific extensions to the {@link java.sql.RowId} interface. 9 | */ 10 | public interface FirebirdRowId extends RowId { 11 | /* Empty interface retained for potential future extension */ 12 | } 13 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/FirebirdSavepoint.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2005 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2011-2015 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 4 | package org.firebirdsql.jdbc; 5 | 6 | import java.sql.Savepoint; 7 | 8 | /** 9 | * Firebird-specific extensions to the {@link java.sql.Savepoint} interface. 10 | */ 11 | public interface FirebirdSavepoint extends Savepoint { 12 | /* Empty interface retained for backwards compatibility and potential future extension */ 13 | } 14 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/JaybirdTypeCodes.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018-2020 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.jdbc; 4 | 5 | import org.firebirdsql.util.Volatile; 6 | 7 | /** 8 | * Type codes specific for Jaybird. 9 | * 10 | * @author Mark Rotteveel 11 | */ 12 | @Volatile(reason = "Defined type codes may receive a different value when standardized in JDBC") 13 | public final class JaybirdTypeCodes { 14 | 15 | // TODO Remove when standardized in JDBC 16 | 17 | @Volatile(reason = "To be standardized by future version of JDBC, type code may change") 18 | public static final int DECFLOAT = -6001; 19 | 20 | private JaybirdTypeCodes() { 21 | // no instances 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/escape/ConstantSQLFunction.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.escape; 4 | 5 | /** 6 | * Implementation of {@link SQLFunction} for constants or functions without parameters. 7 | * 8 | * @author Mark Rotteveel 9 | * @since 4.0 10 | */ 11 | final class ConstantSQLFunction implements SQLFunction { 12 | 13 | private final String functionConstant; 14 | 15 | ConstantSQLFunction(String functionConstant) { 16 | this.functionConstant = functionConstant; 17 | } 18 | 19 | @Override 20 | public String apply(String... parameters) throws FBSQLParseException { 21 | if (parameters.length > 0) { 22 | throw new FBSQLParseException( 23 | "Invalid number of arguments, expected no arguments, received " + parameters.length); 24 | } 25 | return functionConstant; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/escape/FBSQLParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: Copyright 2001-2002 David Jencks 3 | SPDX-FileCopyrightText: Copyright 2002-2003 Roman Rokytskyy 4 | SPDX-FileCopyrightText: Copyright 2012-2024 Mark Rotteveel 5 | SPDX-License-Identifier: LGPL-2.1-or-later 6 | */ 7 | package org.firebirdsql.jdbc.escape; 8 | 9 | import org.firebirdsql.jdbc.SQLStateConstants; 10 | 11 | import java.io.Serial; 12 | import java.sql.SQLSyntaxErrorException; 13 | 14 | /** 15 | * This exception is thrown by FBEscapedParser when it cannot parse the 16 | * escaped syntax. 17 | * 18 | * @author Roman Rokytskyy 19 | */ 20 | public class FBSQLParseException extends SQLSyntaxErrorException { 21 | 22 | @Serial 23 | private static final long serialVersionUID = 4217078230221445003L; 24 | 25 | public FBSQLParseException(String msg) { 26 | super(msg, SQLStateConstants.SQL_STATE_INVALID_ESCAPE_SEQ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/escape/LocateFunction.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.escape; 4 | 5 | /** 6 | * Implements the {@code LOCATE} JDBC escape 7 | * 8 | * @author Mark Rotteveel 9 | * @since 4.0 10 | */ 11 | final class LocateFunction implements SQLFunction { 12 | 13 | private static final SQLFunction POSITION_FROM_START = new PatternSQLFunction("POSITION({0},{1})"); 14 | private static final SQLFunction POSITION_FROM_INDEX = new PatternSQLFunction("POSITION({0},{1},{2})"); 15 | 16 | @Override 17 | public String apply(String... parameters) throws FBSQLParseException { 18 | switch (parameters.length) { 19 | case 2: 20 | return POSITION_FROM_START.apply(parameters); 21 | case 3: 22 | return POSITION_FROM_INDEX.apply(parameters); 23 | default: 24 | throw new FBSQLParseException("Expected 2 or 3 parameters for LOCATE, received " + parameters.length); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/escape/SQLFunction.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.escape; 4 | 5 | /** 6 | * SQL function call for processing JDBC function escapes 7 | * 8 | * @author Mark Rotteveel 9 | * @since 4.0 10 | */ 11 | interface SQLFunction { 12 | 13 | /** 14 | * Render this function call with the supplied parameters. 15 | * 16 | * @param parameters 17 | * Parameters for the function call. 18 | * @return Rendered function call, or {@code null} to fallback to server-side handling 19 | * @throws FBSQLParseException 20 | * Optionally, if the number of parameters or values of parameters are invalid 21 | */ 22 | String apply(String... parameters) throws FBSQLParseException; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/escape/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of JDBC escapes for the Jaybird Firebird JDBC driver. 5 | */ 6 | @InternalApi 7 | @NullMarked 8 | package org.firebirdsql.jdbc.escape; 9 | 10 | import org.firebirdsql.util.InternalApi; 11 | import org.jspecify.annotations.NullMarked; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/BlobListenableField.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.field; 4 | 5 | import org.firebirdsql.jdbc.FBObjectListener; 6 | import org.firebirdsql.util.InternalApi; 7 | import org.jspecify.annotations.NullMarked; 8 | 9 | /** 10 | * Field which expects a blob listener. 11 | * 12 | * @author Mark Rotteveel 13 | * @since 5 14 | */ 15 | @InternalApi 16 | @NullMarked 17 | public interface BlobListenableField { 18 | 19 | /** 20 | * Sets the blob listener of the field. 21 | * 22 | * @param blobListener 23 | * blob listener 24 | */ 25 | void setBlobListener(FBObjectListener.BlobListener blobListener); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/FBCloseableField.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2020 Vasiliy Yashkov 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.field; 4 | 5 | import java.sql.SQLException; 6 | 7 | /** 8 | * Instances of this field have open resources and must be cleaned up. 9 | * 10 | * @author Vasiliy Yashkov 11 | * @since 5 12 | */ 13 | public interface FBCloseableField { 14 | 15 | /** 16 | * Close this field. This method tells field implementation to release all 17 | * resources allocated when field methods were called. 18 | * 19 | * @throws SQLException 20 | * if field cannot be closed. 21 | */ 22 | void close() throws SQLException; 23 | } 24 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/FBRowIdField.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2017-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.field; 4 | 5 | import org.firebirdsql.gds.ng.fields.FieldDescriptor; 6 | import org.jspecify.annotations.NullMarked; 7 | 8 | import java.sql.SQLException; 9 | 10 | /** 11 | * Field for row id fields (DB_KEY/RDB$DB_KEY). 12 | *

13 | * The implementation inherits from {@link FBBinaryField} so it can still behave in a backwards-compatible manner 14 | * with previous Jaybird versions (except for the behavior of {@link #getObject()}). 15 | *

16 | * 17 | * @author Mark Rotteveel 18 | * @since 4.0 19 | */ 20 | class FBRowIdField extends FBBinaryField { 21 | 22 | @NullMarked 23 | FBRowIdField(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, int requiredType) 24 | throws SQLException { 25 | super(fieldDescriptor, dataProvider, requiredType); 26 | } 27 | 28 | @Override 29 | public Object getObject() throws SQLException { 30 | return getRowId(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/FBTimeTzField.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.field; 4 | 5 | import org.firebirdsql.gds.ng.fields.FieldDescriptor; 6 | import org.jspecify.annotations.NullMarked; 7 | 8 | import java.sql.SQLException; 9 | import java.time.OffsetTime; 10 | 11 | /** 12 | * Field for {@code TIME WITH TIME ZONE}. 13 | * 14 | * @author Mark Rotteveel 15 | * @since 4.0 16 | */ 17 | class FBTimeTzField extends AbstractWithTimeZoneField { 18 | 19 | @NullMarked 20 | FBTimeTzField(FieldDescriptor fieldDescriptor, FieldDataProvider dataProvider, int requiredType) 21 | throws SQLException { 22 | super(fieldDescriptor, dataProvider, requiredType); 23 | } 24 | 25 | @Override 26 | public Object getObject() throws SQLException { 27 | return getOffsetTime(); 28 | } 29 | 30 | @Override 31 | public String getString() throws SQLException { 32 | OffsetTime offsetTime = getOffsetTime(); 33 | return offsetTime != null ? offsetTime.toString() : null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/FieldDataProvider.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2004 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2018-2024 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | package org.firebirdsql.jdbc.field; 5 | 6 | import org.jspecify.annotations.Nullable; 7 | 8 | /** 9 | * Provider of the row data. 10 | * 11 | * @author Roman Rokytskyy 12 | */ 13 | public interface FieldDataProvider { 14 | 15 | /** 16 | * Get raw content of the filed. This method returns the array of bytes sent 17 | * by the server back. 18 | * 19 | * @return contents of the field or null if NULL value was 20 | * sent from the server. 21 | */ 22 | byte @Nullable [] getFieldData(); 23 | 24 | /** 25 | * Set raw content of the field. 26 | * 27 | * @param data raw content of the field. 28 | */ 29 | void setFieldData(byte @Nullable [] data); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/TypeConversionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: Copyright 2002-2003 Roman Rokytskyy 3 | SPDX-FileCopyrightText: Copyright 2002 David Jencks 4 | SPDX-FileCopyrightText: Copyright 2003 Blas Rodriguez Somoza 5 | SPDX-FileCopyrightText: Copyright 2011-2024 Mark Rotteveel 6 | SPDX-License-Identifier: LGPL-2.1-or-later 7 | */ 8 | package org.firebirdsql.jdbc.field; 9 | 10 | import org.firebirdsql.jdbc.SQLStateConstants; 11 | 12 | import java.io.Serial; 13 | import java.sql.SQLNonTransientException; 14 | 15 | /** 16 | * This exception is thrown when the requested type conversion cannot be 17 | * performed. 18 | * @author Roman Rokytskyy 19 | * @version 1.0 20 | */ 21 | public class TypeConversionException extends SQLNonTransientException { 22 | 23 | @Serial 24 | private static final long serialVersionUID = 9145386635318036933L; 25 | 26 | public TypeConversionException(String msg) { 27 | super(msg, SQLStateConstants.SQL_STATE_INVALID_CONVERSION); 28 | } 29 | 30 | public TypeConversionException(String msg, Throwable cause) { 31 | super(msg, SQLStateConstants.SQL_STATE_INVALID_CONVERSION, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/field/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of fields for getting or setting result set columns or prepared statement parameters. 5 | */ 6 | @InternalApi 7 | package org.firebirdsql.jdbc.field; 8 | 9 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/metadata/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * The classes in this packages support or provide parts of the implementation of {@link java.sql.DatabaseMetaData}. 5 | *

6 | * This package is an implementation detail and not part of the public API of Jaybird. Its contents may change 7 | * drastically between point release or may even be removed without notice. Do not rely on it directly, but instead use 8 | * {@link java.sql.DatabaseMetaData}. 9 | *

10 | * 11 | * @author Mark Rotteveel 12 | * @since 4 13 | */ 14 | @InternalApi 15 | package org.firebirdsql.jdbc.metadata; 16 | 17 | import org.firebirdsql.util.InternalApi; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/jdbc/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Implementation of the JDBC API for the Firebird database. 5 | *

6 | * For detailed user documentation, please consult Jaybird JDBC Driver Java Programmer’s Manual. 7 | *

8 | */ 9 | package org.firebirdsql.jdbc; -------------------------------------------------------------------------------- /src/main/org/firebirdsql/util/InternalApi.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018-2019 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.util; 4 | 5 | import java.lang.annotation.Documented; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | /** 10 | * Indicates that the annotated package, class, method or value is for internal use only. 11 | *

12 | * Future versions may radically change, move, or make inaccessible this type. 13 | *

14 | * 15 | * @author Mark Rotteveel 16 | */ 17 | @Documented 18 | @Retention(RetentionPolicy.SOURCE) 19 | public @interface InternalApi { 20 | } 21 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/util/Volatile.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause 3 | package org.firebirdsql.util; 4 | 5 | import java.lang.annotation.Documented; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | /** 10 | * Indicates that the annotated class, method or value is volatile, and may change in a next version. 11 | * 12 | * @author Mark Rotteveel 13 | */ 14 | @Documented 15 | @Retention(RetentionPolicy.SOURCE) 16 | public @interface Volatile { 17 | 18 | String reason(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/org/firebirdsql/util/package-info.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022-2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | /** 4 | * Utility classes for use by Jaybird. 5 | *

6 | * With the exception of {@link org.firebirdsql.util.FirebirdSupportInfo}, all other classes are internal API and should 7 | * not be used outside of Jaybird. These other classes may be removed to a different package in a future release. 8 | *

9 | */ 10 | @InternalApi 11 | @NullMarked 12 | package org.firebirdsql.util; 13 | 14 | import org.jspecify.annotations.NullMarked; -------------------------------------------------------------------------------- /src/resources/META-INF/services/java.sql.Driver: -------------------------------------------------------------------------------- 1 | org.firebirdsql.jdbc.FBDriver -------------------------------------------------------------------------------- /src/resources/META-INF/services/org.firebirdsql.encodings.EncodingSet: -------------------------------------------------------------------------------- 1 | org.firebirdsql.encodings.DefaultEncodingSet -------------------------------------------------------------------------------- /src/resources/META-INF/services/org.firebirdsql.gds.impl.GDSFactoryPlugin: -------------------------------------------------------------------------------- 1 | org.firebirdsql.gds.impl.wire.WireGDSFactoryPlugin 2 | -------------------------------------------------------------------------------- /src/resources/META-INF/services/org.firebirdsql.gds.ng.wire.ProtocolDescriptor: -------------------------------------------------------------------------------- 1 | org.firebirdsql.gds.ng.wire.version10.Version10Descriptor 2 | org.firebirdsql.gds.ng.wire.version11.Version11Descriptor 3 | org.firebirdsql.gds.ng.wire.version12.Version12Descriptor 4 | org.firebirdsql.gds.ng.wire.version13.Version13Descriptor 5 | org.firebirdsql.gds.ng.wire.version15.Version15Descriptor 6 | org.firebirdsql.gds.ng.wire.version16.Version16Descriptor 7 | org.firebirdsql.gds.ng.wire.version18.Version18Descriptor 8 | org.firebirdsql.gds.ng.wire.version19.Version19Descriptor 9 | -------------------------------------------------------------------------------- /src/resources/META-INF/services/org.firebirdsql.gds.ng.wire.auth.AuthenticationPluginSpi: -------------------------------------------------------------------------------- 1 | org.firebirdsql.gds.ng.wire.auth.legacy.LegacyAuthenticationPluginSpi 2 | org.firebirdsql.gds.ng.wire.auth.srp.SrpAuthenticationPluginSpi 3 | org.firebirdsql.gds.ng.wire.auth.srp.Srp224AuthenticationPluginSpi 4 | org.firebirdsql.gds.ng.wire.auth.srp.Srp256AuthenticationPluginSpi 5 | org.firebirdsql.gds.ng.wire.auth.srp.Srp384AuthenticationPluginSpi 6 | org.firebirdsql.gds.ng.wire.auth.srp.Srp512AuthenticationPluginSpi 7 | -------------------------------------------------------------------------------- /src/resources/META-INF/services/org.firebirdsql.gds.ng.wire.crypt.EncryptionPluginSpi: -------------------------------------------------------------------------------- 1 | org.firebirdsql.gds.ng.wire.crypt.arc4.Arc4EncryptionPluginSpi 2 | org.firebirdsql.gds.ng.wire.crypt.chacha.ChaChaEncryptionPluginSpi 3 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_14_error_msg.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 336461924=Row not found for fetch, update or delete, or the result of a query is an empty table. 5 | 336461925=segment buffer length shorter than expected 6 | 336462125=Datatype needs modification 7 | 336462436=Duplicate column or domain name found. 8 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_18_sql_states.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 336723983=00000 5 | 336723984=00000 6 | 336723985=00000 7 | 336723986=00000 8 | 336723987=00000 9 | 336723988=00000 10 | 336723989=00000 11 | 336723990=00000 12 | 336723991=00000 13 | 336723992=00000 14 | 336723996=00000 15 | 336723997=00000 16 | 336723998=00000 17 | 336723999=00000 18 | 336724000=00000 19 | 336724001=00000 20 | 336724002=00000 21 | 336724003=00000 22 | 336724004=00000 23 | 336724005=00000 24 | 336724006=00000 25 | 336724008=00000 26 | 336724009=00000 27 | 336724010=00000 28 | 336724011=00000 29 | 336724012=00000 30 | 336724044=00000 31 | 336724045=00000 32 | 336724046=00000 33 | 336724047=00000 34 | 336724048=00000 35 | 336724049=00000 36 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_21_sql_states.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 336920577=00000 5 | 336920578=00000 6 | 336920579=00000 7 | 336920580=00000 8 | 336920605=00000 9 | 336920606=00000 10 | 336920607=00000 11 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_22_sql_states.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 336986113=00000 5 | 336986114=00000 6 | 336986115=00000 7 | 336986116=00000 8 | 336986117=00000 9 | 336986118=00000 10 | 336986159=00000 11 | 336986160=00000 12 | 336986161=00000 13 | 336986162=00000 14 | 336986164=00000 15 | 336986170=00000 16 | 336986171=00000 17 | 336986172=00000 18 | 336986173=00000 19 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_23_error_msg.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 337051649=Switches trusted_user and trusted_role are not supported from command line 5 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_23_sql_states.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 337051649=00000 5 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_25_sql_states.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 337182750=00000 5 | 337182751=00000 6 | 337182752=00000 7 | 337182753=00000 8 | 337182754=00000 9 | 337182755=00000 10 | 337182756=00000 11 | 337182757=00000 12 | 337182758=00000 13 | 337182759=00000 14 | 337182760=00000 15 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/firebird_3_sql_states.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2000-2024 Firebird development team and individual contributors 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # SPDX-FileComment: The keys and values listed here were obtained from the Firebird sources, which are licensed under the IPL (InterBase Public License) and/or IDPL (Initial Developer Public License), both are variants of the Mozilla Public License version 1.1 4 | 335740929=00000 5 | 335740930=00000 6 | 335740932=00000 7 | 335740933=00000 8 | 335740934=00000 9 | 335740935=00000 10 | 335740936=00000 11 | 335740937=00000 12 | 335740940=00000 13 | 335740941=00000 14 | 335740942=00000 15 | 335740943=00000 16 | 335740944=00000 17 | 335740945=00000 18 | 335740946=00000 19 | 335740947=00000 20 | 335740948=00000 21 | 335740951=00000 22 | 335740991=00000 23 | 335740992=00000 24 | 335740993=00000 25 | 335740994=00000 26 | 335740995=00000 27 | 335741012=00000 28 | 335741018=00000 29 | 335741036=00000 30 | 335741038=00000 31 | 335741042=00000 32 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/jaybird/version.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2019 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | jaybird.version.simple=@VERSION@ 4 | jaybird.version.display=@NAME@ @MAVEN_NAME@-@VERSION_FULL@ 5 | jaybird.version.major=@VERSION_MAJOR@ 6 | jaybird.version.minor=@VERSION_MINOR@ 7 | -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/jdbc/reserved_words_2_5.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017-2020 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # 4 | # Reserved words not reserved by SQL:2003 5 | # This file is only provided for reference, see FirebirdVersionMetaData for actually used values 6 | ADD 7 | ADMIN 8 | BIT_LENGTH 9 | CURRENT_CONNECTION 10 | CURRENT_TRANSACTION 11 | GDSCODE 12 | INDEX 13 | LONG 14 | MAXIMUM_SEGMENT 15 | PLAN 16 | POST_EVENT 17 | RDB$DB_KEY 18 | RECORD_VERSION 19 | RECREATE 20 | RETURNING_VALUES 21 | ROW_COUNT 22 | SQLCODE 23 | VARIABLE 24 | VIEW 25 | WHILE -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/jdbc/reserved_words_3_0.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017-2020 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # 4 | # Reserved words not reserved by SQL:2003 5 | # This file is only provided for reference, see FirebirdVersionMetaData for actually used values 6 | ADD 7 | ADMIN 8 | BIT_LENGTH 9 | CURRENT_CONNECTION 10 | CURRENT_TRANSACTION 11 | DELETING 12 | GDSCODE 13 | INDEX 14 | INSERTING 15 | LONG 16 | OFFSET 17 | PLAN 18 | POST_EVENT 19 | RDB$DB_KEY 20 | RDB$RECORD_VERSION 21 | RECORD_VERSION 22 | RECREATE 23 | RETURNING_VALUES 24 | ROW_COUNT 25 | SQLCODE 26 | UPDATING 27 | VARIABLE 28 | VIEW 29 | WHILE -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/jdbc/reserved_words_4_0.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017-2021 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # 4 | # Reserved words not reserved by SQL:2003 5 | # This file is only provided for reference, see FirebirdVersionMetaData for actually used values 6 | ADD 7 | ADMIN 8 | BIT_LENGTH 9 | COMMENT 10 | CURRENT_CONNECTION 11 | CURRENT_TRANSACTION 12 | DECFLOAT 13 | DELETING 14 | GDSCODE 15 | INDEX 16 | INSERTING 17 | INT128 18 | LONG 19 | OFFSET 20 | PLAN 21 | POST_EVENT 22 | PUBLICATION 23 | RDB$DB_KEY 24 | RDB$ERROR 25 | RDB$GET_CONTEXT 26 | RDB$GET_TRANSACTION_CN 27 | RDB$RECORD_VERSION 28 | RDB$ROLE_IN_USE 29 | RDB$SET_CONTEXT 30 | RDB$SYSTEM_PRIVILEGE 31 | RECORD_VERSION 32 | RECREATE 33 | RESETTING 34 | RETURNING_VALUES 35 | ROW_COUNT 36 | SQLCODE 37 | UNBOUNDED 38 | UPDATING 39 | VARBINARY 40 | VARIABLE 41 | VIEW 42 | WHILE -------------------------------------------------------------------------------- /src/resources/org/firebirdsql/jdbc/reserved_words_5_0.txt: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2017-2023 Mark Rotteveel 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | # 4 | # Reserved words not reserved by SQL:2003 5 | # This file is only provided for reference, see FirebirdVersionMetaData for actually used values 6 | ADD 7 | ADMIN 8 | BIT_LENGTH 9 | COMMENT 10 | CURRENT_CONNECTION 11 | CURRENT_TRANSACTION 12 | DECFLOAT 13 | DELETING 14 | GDSCODE 15 | INDEX 16 | INSERTING 17 | INT128 18 | LONG 19 | OFFSET 20 | PLAN 21 | POST_EVENT 22 | PUBLICATION 23 | RDB$DB_KEY 24 | RDB$ERROR 25 | RDB$GET_CONTEXT 26 | RDB$GET_TRANSACTION_CN 27 | RDB$RECORD_VERSION 28 | RDB$ROLE_IN_USE 29 | RDB$SET_CONTEXT 30 | RDB$SYSTEM_PRIVILEGE 31 | RECORD_VERSION 32 | RECREATE 33 | RESETTING 34 | RETURNING_VALUES 35 | ROW_COUNT 36 | SQLCODE 37 | UNBOUNDED 38 | UPDATING 39 | VARBINARY 40 | VARIABLE 41 | VIEW 42 | WHILE -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/StreamHelper.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common; 4 | 5 | import java.util.stream.IntStream; 6 | 7 | /** 8 | * Helpers for stream operations. 9 | * 10 | * @author Mark Rotteveel 11 | * @since 5 12 | */ 13 | public class StreamHelper { 14 | 15 | /** 16 | * Returns an {@link IntStream} that iterates from {@code maxValue} to {@code minValue}. 17 | * 18 | * @param minValue Minimum (destination) value (inclusive) 19 | * @param maxValue Maximum (starting) value (inclusive) 20 | * @return stream over a closed range 21 | */ 22 | public static IntStream reverseClosedRange(int minValue, int maxValue) { 23 | return IntStream.rangeClosed(minValue, maxValue) 24 | .map(i -> maxValue - i + minValue); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/StreamHelperTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; 8 | 9 | class StreamHelperTest { 10 | 11 | @Test 12 | void testReverseClosedRange() { 13 | int[] result = StreamHelper.reverseClosedRange(1, 5).toArray(); 14 | 15 | assertArrayEquals(new int[] { 5, 4, 3, 2, 1 }, result); 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/StringSocketFactory.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common; 4 | 5 | /** 6 | * Socket factory for testing the {@code socketFactory} connection property with a {@link String} constructor argument. 7 | *

8 | * Contrary to {@link NoArgSocketFactory} and {@link PropertiesSocketFactory}, this variant does not allow socket 9 | * creation. 10 | *

11 | * 12 | * @author Mark Rotteveel 13 | */ 14 | public final class StringSocketFactory extends BaseSocketFactory { 15 | 16 | @SuppressWarnings("unused") 17 | public StringSocketFactory(String arg) { 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/function/ThrowingBiConsumer.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common.function; 4 | 5 | public interface ThrowingBiConsumer { 6 | 7 | void accept(T t, U u) throws Throwable; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/function/ThrowingBiFunction.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common.function; 4 | 5 | @FunctionalInterface 6 | public interface ThrowingBiFunction { 7 | 8 | R apply(T t, U u) throws Exception; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/function/ThrowingTriConsumer.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common.function; 4 | 5 | public interface ThrowingTriConsumer { 6 | 7 | void accept(T t, U u, V v) throws Throwable; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/function/UncheckedCloseable.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common.function; 4 | 5 | /** 6 | * Specialization of {@link AutoCloseable} which does not throw checked exceptions. 7 | * 8 | * @author Mark Rotteveel 9 | */ 10 | public interface UncheckedCloseable extends AutoCloseable { 11 | 12 | @Override 13 | void close(); 14 | } 15 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/common/matchers/RegexMatcher.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2020 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.common.matchers; 4 | 5 | import org.hamcrest.*; 6 | 7 | import java.util.regex.Pattern; 8 | 9 | /** 10 | * Hamcrest matcher for string matching a regular expression. 11 | * 12 | * @author Mark Rotteveel 13 | */ 14 | public class RegexMatcher extends TypeSafeMatcher { 15 | 16 | private final Pattern pattern; 17 | 18 | private RegexMatcher(String regex) { 19 | this(Pattern.compile(regex)); 20 | } 21 | 22 | private RegexMatcher(Pattern pattern) { 23 | this.pattern = pattern; 24 | } 25 | 26 | @Override 27 | protected boolean matchesSafely(String s) { 28 | return s != null && pattern.matcher(s).matches(); 29 | } 30 | 31 | @Override 32 | public void describeTo(Description description) { 33 | description.appendText("a string match regular expression ").appendValue(pattern); 34 | } 35 | 36 | public static RegexMatcher matchesRegex(String regex) { 37 | return new RegexMatcher(regex); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/ds/ConnectionEventMatcher.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2011-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.ds; 4 | 5 | import org.hamcrest.Matcher; 6 | import org.mockito.ArgumentMatcher; 7 | 8 | import javax.sql.ConnectionEvent; 9 | import javax.sql.PooledConnection; 10 | import java.sql.SQLException; 11 | 12 | /** 13 | * Matcher to check for ConnectionEvents 14 | * 15 | * @author Mark Rotteveel 16 | */ 17 | class ConnectionEventMatcher implements ArgumentMatcher { 18 | private final PooledConnection pooled; 19 | private final Matcher exceptionMatcher; 20 | 21 | public ConnectionEventMatcher(PooledConnection pooled, Matcher exceptionMatcher) { 22 | this.pooled = pooled; 23 | this.exceptionMatcher = exceptionMatcher; 24 | } 25 | 26 | @Override 27 | public boolean matches(ConnectionEvent item) { 28 | return item.getSource() == pooled && exceptionMatcher.matches(item.getSQLException()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/encodings/CharacterDecodingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2004 Roman Rokytskyy 2 | // SPDX-FileCopyrightText: Copyright 2013-2022 Mark Rotteveel 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | package org.firebirdsql.encodings; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | 10 | class CharacterDecodingTest { 11 | 12 | @Test 13 | void testOriginal() { 14 | IEncodingFactory factory = EncodingFactory.getPlatformDefault(); 15 | Encoding encoding = factory.getEncodingForFirebirdName("ISO8859_1"); 16 | String testStr = encoding.decodeFromCharset(new byte[] { 0x61, 0x62, 0x63 }); 17 | assertEquals("\u0061\u0062\u0063", testStr, "Strings should be equal"); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/FbServicePropertiesTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2024 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng; 4 | 5 | import org.firebirdsql.gds.JaybirdSystemProperties; 6 | import org.junit.jupiter.params.ParameterizedTest; 7 | import org.junit.jupiter.params.provider.NullAndEmptySource; 8 | import org.junit.jupiter.params.provider.ValueSource; 9 | 10 | import static org.firebirdsql.common.SystemPropertyHelper.withTemporarySystemProperty; 11 | import static org.junit.jupiter.api.Assertions.assertEquals; 12 | 13 | /** 14 | * Tests for {@link FbServiceProperties}. 15 | */ 16 | class FbServicePropertiesTest { 17 | 18 | @ParameterizedTest 19 | @NullAndEmptySource 20 | @ValueSource(strings = { "*", "11" }) 21 | void enableProtocolDefaultDerivedFromSystemProperty(String defaultValue) { 22 | try (var ignored = withTemporarySystemProperty(JaybirdSystemProperties.DEFAULT_ENABLE_PROTOCOL, defaultValue)) { 23 | assertEquals(defaultValue, new FbServiceProperties().getEnableProtocol(), 24 | "Unexpected enableProtocol value"); 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/SimpleEventHandler.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng; 4 | 5 | import org.firebirdsql.gds.EventHandle; 6 | import org.firebirdsql.gds.EventHandler; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | */ 15 | public class SimpleEventHandler implements EventHandler { 16 | 17 | private final List receivedEventHandles = Collections.synchronizedList(new ArrayList()); 18 | 19 | @Override 20 | public void eventOccurred(EventHandle eventHandle) { 21 | receivedEventHandles.add(eventHandle); 22 | } 23 | 24 | public List getReceivedEventHandles() { 25 | synchronized (receivedEventHandles) { 26 | return new ArrayList(receivedEventHandles); 27 | } 28 | } 29 | 30 | public void clearEvents() { 31 | receivedEventHandles.clear(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/SimpleWarningMessageCallback.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng; 4 | 5 | import java.sql.SQLWarning; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Implementation of {@link WarningMessageCallback} for testing. 11 | * 12 | * @author Mark Rotteveel 13 | * @since 3.0 14 | */ 15 | public class SimpleWarningMessageCallback implements WarningMessageCallback { 16 | 17 | private final List warnings = new ArrayList<>(); 18 | 19 | @Override 20 | public void processWarning(SQLWarning warning) { 21 | warnings.add(warning); 22 | } 23 | 24 | /** 25 | * @return List with received warnings (direct access) 26 | */ 27 | public List getWarnings() { 28 | return warnings; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11CommonConnectionInfo.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.gds.ng.wire.FbWireDatabase; 6 | import org.firebirdsql.gds.ng.wire.FbWireService; 7 | import org.firebirdsql.gds.ng.wire.ProtocolDescriptor; 8 | import org.firebirdsql.gds.ng.wire.version10.V10CommonConnectionInfo; 9 | import org.firebirdsql.gds.ng.wire.version10.V10Service; 10 | 11 | /** 12 | * Class to contain common connection information shared by the V11 tests. 13 | * 14 | * @author Mark Rotteveel 15 | * @since 3.0 16 | */ 17 | public class V11CommonConnectionInfo extends V10CommonConnectionInfo { 18 | V11CommonConnectionInfo() { 19 | this(new Version11Descriptor(), V11Database.class, V10Service.class); 20 | } 21 | 22 | public V11CommonConnectionInfo(ProtocolDescriptor protocolDescriptor, 23 | Class expectedDatabaseType, Class expectedServiceType) { 24 | super(protocolDescriptor, expectedDatabaseType, expectedServiceType); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11DatabaseTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version10.V10DatabaseTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version11.V11Database}, reuses test for V10. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V11DatabaseTest extends V10DatabaseTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(11); 23 | 24 | protected V11CommonConnectionInfo commonConnectionInfo() { 25 | return new V11CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version10.V10EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link org.firebirdsql.gds.ng.wire.version11.V11Database}, reuses test for V10. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V11EventHandlingTest extends V10EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(11); 23 | 24 | protected V11CommonConnectionInfo commonConnectionInfo() { 25 | return new V11CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11InputBlobTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version10.V10InputBlobTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10InputBlob} in the version 11 protocol 14 | * (note: there is no version 11 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 3.0 18 | */ 19 | public class V11InputBlobTest extends V10InputBlobTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(11); 24 | 25 | @Override 26 | protected V11CommonConnectionInfo commonConnectionInfo() { 27 | return new V11CommonConnectionInfo(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version10.V10ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V11 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V11ServiceTest extends V10ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(11); 23 | 24 | protected V11CommonConnectionInfo commonConnectionInfo() { 25 | return new V11CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version10.V10TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 11 protocol 14 | * (note: there is no version 11 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 3.0 18 | */ 19 | public class V11TransactionTest extends V10TransactionTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(11); 24 | 25 | protected V11CommonConnectionInfo commonConnectionInfo() { 26 | return new V11CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version11/V11WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version11; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version10.V10WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 3.0 15 | */ 16 | public class V11WireOperationsTest extends V10WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(11); 21 | 22 | protected V11CommonConnectionInfo commonConnectionInfo() { 23 | return new V11CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version12/V12CommonConnectionInfo.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.gds.ng.wire.FbWireDatabase; 6 | import org.firebirdsql.gds.ng.wire.FbWireService; 7 | import org.firebirdsql.gds.ng.wire.ProtocolDescriptor; 8 | import org.firebirdsql.gds.ng.wire.version10.V10Service; 9 | import org.firebirdsql.gds.ng.wire.version11.V11CommonConnectionInfo; 10 | 11 | /** 12 | * Class to contain common connection information shared by the V12 tests. 13 | * 14 | * @author Mark Rotteveel 15 | * @since 3.0 16 | */ 17 | public class V12CommonConnectionInfo extends V11CommonConnectionInfo { 18 | 19 | V12CommonConnectionInfo() { 20 | this(new Version12Descriptor(), V12Database.class, V10Service.class); 21 | } 22 | 23 | public V12CommonConnectionInfo(ProtocolDescriptor protocolDescriptor, 24 | Class expectedDatabaseType, Class expectedServiceType) { 25 | super(protocolDescriptor, expectedDatabaseType, expectedServiceType); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version12/V12EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version11.V11EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link org.firebirdsql.gds.ng.wire.version12.V12Database}, reuses test for V11. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V12EventHandlingTest extends V11EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(12); 23 | 24 | protected V12CommonConnectionInfo commonConnectionInfo() { 25 | return new V12CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version12/V12ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version11.V11ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V12 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V12ServiceTest extends V11ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(12); 23 | 24 | protected V12CommonConnectionInfo commonConnectionInfo() { 25 | return new V12CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version12/V12StatementTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version11.V11StatementTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version12.V12Statement}, reuses test for V11. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V12StatementTest extends V11StatementTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(12); 23 | 24 | protected V12CommonConnectionInfo commonConnectionInfo() { 25 | return new V12CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version12/V12TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2014-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version11.V11TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 12 protocol 14 | * (note: there is no version 12 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 3.0 18 | */ 19 | public class V12TransactionTest extends V11TransactionTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(12); 24 | 25 | protected V12CommonConnectionInfo commonConnectionInfo() { 26 | return new V12CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version12/V12WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version12; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version11.V11WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 3.0 15 | */ 16 | public class V12WireOperationsTest extends V11WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(12); 21 | 22 | protected V12CommonConnectionInfo commonConnectionInfo() { 23 | return new V12CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version13/V13DatabaseTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version13; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version12.V12DatabaseTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version13.V13Database}, reuses test for V12. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V13DatabaseTest extends V12DatabaseTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(13); 23 | 24 | protected V13CommonConnectionInfo commonConnectionInfo() { 25 | return new V13CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version13/V13EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version13; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version12.V12EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link org.firebirdsql.gds.ng.wire.version13.V13Database}, reuses test for V12. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V13EventHandlingTest extends V12EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(13); 23 | 24 | protected V13CommonConnectionInfo commonConnectionInfo() { 25 | return new V13CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version13/V13ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version13; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version12.V12ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V13 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V13ServiceTest extends V12ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(13); 23 | 24 | protected V13CommonConnectionInfo commonConnectionInfo() { 25 | return new V13CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version13/V13StatementTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version13; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version12.V12StatementTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version13.V13Statement} in the V13 protocol, reuses test for V12. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 3.0 17 | */ 18 | public class V13StatementTest extends V12StatementTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(13); 23 | 24 | protected V13CommonConnectionInfo commonConnectionInfo() { 25 | return new V13CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version13/V13TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version13; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version12.V12TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 13 protocol 14 | * (note: there is no version 13 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | */ 18 | public class V13TransactionTest extends V12TransactionTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(13); 23 | 24 | protected V13CommonConnectionInfo commonConnectionInfo() { 25 | return new V13CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version13/V13WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2015-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version13; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version12.V12WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 3.0 15 | */ 16 | public class V13WireOperationsTest extends V12WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(13); 21 | 22 | protected V13CommonConnectionInfo commonConnectionInfo() { 23 | return new V13CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version15/V15DatabaseTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version13.V13DatabaseTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version15.V15Database}, reuses test for V13. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V15DatabaseTest extends V13DatabaseTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(15); 23 | 24 | protected V15CommonConnectionInfo commonConnectionInfo() { 25 | return new V15CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version15/V15EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version13.V13EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link org.firebirdsql.gds.ng.wire.version15.V15Database}, reuses test for V13. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V15EventHandlingTest extends V13EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(15); 23 | 24 | protected V15CommonConnectionInfo commonConnectionInfo() { 25 | return new V15CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version15/V15ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version13.V13ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V15 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V15ServiceTest extends V13ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(15); 23 | 24 | protected V15CommonConnectionInfo commonConnectionInfo() { 25 | return new V15CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version15/V15StatementTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version13.V13StatementTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version13.V13Statement} in the V15 protocol, reuses test for V13. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V15StatementTest extends V13StatementTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(15); 23 | 24 | protected V15CommonConnectionInfo commonConnectionInfo() { 25 | return new V15CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version15/V15TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version13.V13TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 15 protocol 14 | * (note: there is no version 15 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 4.0 18 | */ 19 | public class V15TransactionTest extends V13TransactionTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(15); 24 | 25 | protected V15CommonConnectionInfo commonConnectionInfo() { 26 | return new V15CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version15/V15WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version15; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version13.V13WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 4.0 15 | */ 16 | public class V15WireOperationsTest extends V13WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(15); 21 | 22 | protected V15CommonConnectionInfo commonConnectionInfo() { 23 | return new V15CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version16/V16DatabaseTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version16; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version15.V15DatabaseTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version16.V16Database}, reuses test for V15. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V16DatabaseTest extends V15DatabaseTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(16); 23 | 24 | protected V16CommonConnectionInfo commonConnectionInfo() { 25 | return new V16CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version16/V16EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version16; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version15.V15EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link org.firebirdsql.gds.ng.wire.version16.V16Database}, reuses test for V15. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V16EventHandlingTest extends V15EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(16); 23 | 24 | protected V16CommonConnectionInfo commonConnectionInfo() { 25 | return new V16CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version16/V16ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version16; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version15.V15ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V16 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 4.0 17 | */ 18 | public class V16ServiceTest extends V15ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(16); 23 | 24 | protected V16CommonConnectionInfo commonConnectionInfo() { 25 | return new V16CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version16/V16TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version16; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version15.V15TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 16 protocol 14 | * (note: there is no version 16 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 4.0 18 | */ 19 | public class V16TransactionTest extends V15TransactionTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(16); 24 | 25 | protected V16CommonConnectionInfo commonConnectionInfo() { 26 | return new V16CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version16/V16WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2019-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version16; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version15.V15WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 4.0 15 | */ 16 | public class V16WireOperationsTest extends V15WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(16); 21 | 22 | protected V16CommonConnectionInfo commonConnectionInfo() { 23 | return new V16CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version18/V18DatabaseTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version16.V16DatabaseTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link V18Database}, reuses test for V16. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 5 17 | */ 18 | public class V18DatabaseTest extends V16DatabaseTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(18); 23 | 24 | protected V18CommonConnectionInfo commonConnectionInfo() { 25 | return new V18CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version18/V18EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version16.V16EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link V18Database}, reuses test for V16. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 5 17 | */ 18 | public class V18EventHandlingTest extends V16EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(18); 23 | 24 | protected V18CommonConnectionInfo commonConnectionInfo() { 25 | return new V18CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version18/V18ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version16.V16ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V18 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 5 17 | */ 18 | public class V18ServiceTest extends V16ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(18); 23 | 24 | protected V18CommonConnectionInfo commonConnectionInfo() { 25 | return new V18CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version18/V18StatementTimeoutTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version16.V16StatementTimeoutTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link V18Statement} timeouts in the V18 protocol, reuses tests for V16. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 5 17 | */ 18 | public class V18StatementTimeoutTest extends V16StatementTimeoutTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(18); 23 | 24 | protected V18CommonConnectionInfo commonConnectionInfo() { 25 | return new V18CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version18/V18TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version16.V16TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 18 protocol 14 | * (note: there is no version 18 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 5 18 | */ 19 | public class V18TransactionTest extends V16TransactionTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(18); 24 | 25 | protected V18CommonConnectionInfo commonConnectionInfo() { 26 | return new V18CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version18/V18WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version18; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version16.V16WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 5 15 | */ 16 | public class V18WireOperationsTest extends V16WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(18); 21 | 22 | protected V18CommonConnectionInfo commonConnectionInfo() { 23 | return new V18CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19DatabaseTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18DatabaseTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link V19Database}, reuses test for V18. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 7 17 | */ 18 | public class V19DatabaseTest extends V18DatabaseTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 23 | 24 | protected V19CommonConnectionInfo commonConnectionInfo() { 25 | return new V19CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19EventHandlingTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18EventHandlingTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for events in {@link V19Database}, reuses test for V18. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 7 17 | */ 18 | public class V19EventHandlingTest extends V18EventHandlingTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 23 | 24 | protected V19CommonConnectionInfo commonConnectionInfo() { 25 | return new V19CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19InputBlobTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18InputBlobTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10InputBlob} in the version 19 protocol 14 | * (note: there is no version 19 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 7 18 | */ 19 | public class V19InputBlobTest extends V18InputBlobTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 24 | 25 | protected V19CommonConnectionInfo commonConnectionInfo() { 26 | return new V19CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19OutputBlobTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18OutputBlobTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10OutputBlob} in the version 19 protocol 14 | * (note: there is no version 19 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 7 18 | */ 19 | public class V19OutputBlobTest extends V18OutputBlobTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 24 | 25 | protected V19CommonConnectionInfo commonConnectionInfo() { 26 | return new V19CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19ServiceTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18ServiceTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Service} in the V19 protocol. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 7 17 | */ 18 | public class V19ServiceTest extends V18ServiceTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 23 | 24 | protected V19CommonConnectionInfo commonConnectionInfo() { 25 | return new V19CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19StatementTimeoutTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18StatementTimeoutTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link V19Statement} timeouts in the V19 protocol, reuses tests for V18. 14 | * 15 | * @author Mark Rotteveel 16 | * @since 5 17 | */ 18 | public class V19StatementTimeoutTest extends V18StatementTimeoutTest { 19 | 20 | @RegisterExtension 21 | @Order(1) 22 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 23 | 24 | protected V19CommonConnectionInfo commonConnectionInfo() { 25 | return new V19CommonConnectionInfo(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19TransactionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18TransactionTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * Tests for {@link org.firebirdsql.gds.ng.wire.version10.V10Transaction} in the version 19 protocol 14 | * (note: there is no version 19 specific implementation of this class). 15 | * 16 | * @author Mark Rotteveel 17 | * @since 5 18 | */ 19 | public class V19TransactionTest extends V18TransactionTest { 20 | 21 | @RegisterExtension 22 | @Order(1) 23 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 24 | 25 | protected V19CommonConnectionInfo commonConnectionInfo() { 26 | return new V19CommonConnectionInfo(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/gds/ng/wire/version19/V19WireOperationsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2025 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.gds.ng.wire.version19; 4 | 5 | import org.firebirdsql.common.extension.RequireProtocolExtension; 6 | import org.firebirdsql.gds.ng.wire.version18.V18WireOperationsTest; 7 | import org.junit.jupiter.api.Order; 8 | import org.junit.jupiter.api.extension.RegisterExtension; 9 | 10 | import static org.firebirdsql.common.extension.RequireProtocolExtension.requireProtocolVersion; 11 | 12 | /** 13 | * @author Mark Rotteveel 14 | * @since 7 15 | */ 16 | public class V19WireOperationsTest extends V18WireOperationsTest { 17 | 18 | @RegisterExtension 19 | @Order(1) 20 | public static final RequireProtocolExtension requireProtocol = requireProtocolVersion(19); 21 | 22 | protected V19CommonConnectionInfo commonConnectionInfo() { 23 | return new V19CommonConnectionInfo(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jaybird/parser/FirebirdReservedWordsTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | class FirebirdReservedWordsTest { 10 | 11 | @Test 12 | void latest_returnFIREBIRD_5_0() { 13 | assertThat(FirebirdReservedWords.latest()).isEqualTo(FirebirdReservedWords.FIREBIRD_5_0); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jaybird/parser/QuotedIdentifierTokenTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.parser; 4 | 5 | import org.junit.jupiter.params.ParameterizedTest; 6 | import org.junit.jupiter.params.provider.CsvSource; 7 | 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | class QuotedIdentifierTokenTest { 11 | 12 | @ParameterizedTest 13 | @CsvSource({ 14 | "\"name\", name", 15 | "\"with\"\"double\", with\"double", 16 | "\"with\"\"multiple\"\"double\", with\"multiple\"double" 17 | }) 18 | void quotedIdentifier(String input, String expectedName) { 19 | QuotedIdentifierToken token = new QuotedIdentifierToken(0, input); 20 | 21 | assertThat(token.text()).describedAs("text").isEqualTo(input); 22 | assertThat(token.name()).describedAs("name").isEqualTo(expectedName); 23 | assertThat(token.isValidIdentifier()).describedAs("validIdentifier").isTrue(); 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jaybird/xca/FBXidTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jaybird.xca; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertArrayEquals; 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | 10 | class FBXidTest { 11 | 12 | @Test 13 | void testToBytes() throws Exception { 14 | FBXid xid = new FBXid(123L, 23, new byte[] { 1, 2, 3, 4 }, new byte[] { 5, 6, 7, 8, 9 }); 15 | 16 | byte[] xidBytes = xid.toBytes(); 17 | assertArrayEquals(new byte[] { 1, 5, 0, 0, 0, 23, 6, 0, 0, 0, 4, 1, 2, 3, 4, 4, 0, 0, 0, 5, 5, 6, 7, 8, 9 }, 18 | xidBytes, "unexpected result for xid.toBytes"); 19 | 20 | FBXid newXid = new FBXid(xidBytes, 123L); 21 | 22 | assertEquals(xid, newXid, "expected identical xids after deserialization"); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jdbc/escape/ConstantSQLFunctionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.escape; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.firebirdsql.jdbc.escape.EscapeFunctionAsserts.assertParseException; 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | 10 | class ConstantSQLFunctionTest { 11 | 12 | private static final ConstantSQLFunction function = new ConstantSQLFunction("name"); 13 | 14 | @Test 15 | void testWithoutArguments() throws Exception { 16 | assertEquals("name", function.apply()); 17 | } 18 | 19 | @Test 20 | void testWithArguments() { 21 | assertParseException(() -> assertEquals("name", function.apply("argument")), 22 | "Invalid number of arguments, expected no arguments, received 1"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jdbc/escape/PatternSQLFunctionTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2018-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.escape; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | class PatternSQLFunctionTest { 10 | 11 | private static final PatternSQLFunction function = new PatternSQLFunction("func({0}, {1})"); 12 | 13 | @Test 14 | void testParameterCountEqualToArgumentCount() { 15 | assertEquals("func(?, 'abc')", function.apply("?", "'abc'")); 16 | } 17 | 18 | @Test 19 | void testParameterCountLessThanArgumentCount() { 20 | assertEquals("func(xyz, {1})", function.apply("xyz")); 21 | } 22 | 23 | @Test 24 | void testParameterCountGreaterThanArgumentCount() { 25 | assertEquals("func(?, 'abc')", function.apply("?", "'abc'", "xyz")); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jdbc/field/TrimmableFieldTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2021-2022 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.field; 4 | 5 | import org.junit.jupiter.params.ParameterizedTest; 6 | import org.junit.jupiter.params.provider.CsvSource; 7 | 8 | import static org.junit.jupiter.api.Assertions.*; 9 | 10 | class TrimmableFieldTest { 11 | 12 | @ParameterizedTest(name = "[{index}] [{0}] => [{1}]") 13 | @CsvSource({ 14 | ",", 15 | "'', ''", 16 | "' ', ''", 17 | "' ', ''", 18 | "a, a", 19 | "'a ', a", 20 | "' a', ' a'", 21 | "' a ', ' a'", 22 | "'a ', a", 23 | "'abc ', abc" 24 | }) 25 | void testTrimTrailing(String input, String expectedOutput) { 26 | assertEquals(expectedOutput, TrimmableField.trimTrailing(input)); 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/test/org/firebirdsql/jdbc/metadata/NameHelperTest.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2023 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.jdbc.metadata; 4 | 5 | import org.junit.jupiter.params.ParameterizedTest; 6 | import org.junit.jupiter.params.provider.CsvSource; 7 | 8 | import static org.junit.jupiter.api.Assertions.*; 9 | 10 | class NameHelperTest { 11 | 12 | @ParameterizedTest 13 | @CsvSource(textBlock = """ 14 | , ROUTINE, ROUTINE 15 | PACKAGE, ROUTINE, "PACKAGE"."ROUTINE" 16 | WITH"DOUBLE, DOUBLE"QUOTE, "WITH""DOUBLE"."DOUBLE""QUOTE" 17 | """, nullValues = "") 18 | void testToSpecificName(String catalog, String routineName, String expectedResult) { 19 | assertEquals(expectedResult, NameHelper.toSpecificName(catalog, routineName)); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /src/test/org/firebirdsql/util/Unstable.java: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: Copyright 2016 Mark Rotteveel 2 | // SPDX-License-Identifier: LGPL-2.1-or-later 3 | package org.firebirdsql.util; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * Annotation to indicate that a test is potentially unstable (may lead to false positives). 12 | * 13 | * @author Mark Rotteveel 14 | * @since 3.0 15 | */ 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target({ ElementType.METHOD, ElementType.TYPE}) 18 | public @interface Unstable { 19 | 20 | /** 21 | * (optional) explanation for instability. 22 | */ 23 | String value() default ""; 24 | } 25 | -------------------------------------------------------------------------------- /src/test_resources/org/firebirdsql/jdbc/test_tpb_mapping.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright 2002 Roman Rokytskyy 2 | # SPDX-License-Identifier: LGPL-2.1-or-later 3 | TRANSACTION_SERIALIZABLE=isc_tpb_concurrency,isc_tpb_write,isc_tpb_wait 4 | TRANSACTION_REPEATABLE_READ=isc_tpb_consistency,isc_tpb_write,isc_tpb_wait 5 | TRANSACTION_READ_COMMITTED=isc_tpb_read_committed,isc_tpb_no_rec_version,isc_tpb_write,isc_tpb_nowait -------------------------------------------------------------------------------- /src/test_resources/unit_test_defaults.properties: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: Copyright 2008-2009 Roman Rokytskyy 2 | # SPDX-FileCopyrightText: Copyright 2021 Mark Rotteveel 3 | # SPDX-License-Identifier: LGPL-2.1-or-later 4 | test.db.dir = . 5 | test.db.host = localhost 6 | test.db.port = 3050 7 | test.gds_type = PURE_JAVA 8 | # test.gds_type = NATIVE --------------------------------------------------------------------------------