├── .checkstyle ├── .classpath ├── .fbprefs ├── .gitignore ├── .project ├── .settings ├── org.eclipse.core.resources.prefs ├── org.eclipse.core.runtime.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.jdt.launching.prefs ├── org.eclipse.jdt.ui.prefs ├── org.eclipse.ltk.core.refactoring.prefs └── org.eclipse.wst.xsl.core.prefs ├── CHANGES ├── CONTRIBUTING.md ├── LICENSE ├── README ├── README.md ├── SECURITY.md ├── build.xml └── src ├── build ├── java │ ├── documentation │ │ ├── ErrorMappingsDocGenerator.java │ │ └── PropertiesDocGenerator.java │ └── instrumentation │ │ ├── AddMethods.java │ │ ├── CommonChecks.java │ │ └── TranslateExceptions.java └── misc │ ├── Product.wxs │ ├── debian.in │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── install │ ├── links │ ├── rules │ ├── source │ │ └── format │ └── watch │ ├── pom.xml │ └── rpm.spec.in ├── demo └── java │ └── demo │ └── x │ └── devapi │ └── DevApiSample.java ├── generated └── java │ └── com │ └── mysql │ └── cj │ └── x │ └── protobuf │ ├── Mysqlx.java │ ├── MysqlxConnection.java │ ├── MysqlxCrud.java │ ├── MysqlxCursor.java │ ├── MysqlxDatatypes.java │ ├── MysqlxExpect.java │ ├── MysqlxExpr.java │ ├── MysqlxNotice.java │ ├── MysqlxPrepare.java │ ├── MysqlxResultset.java │ ├── MysqlxSession.java │ ├── MysqlxSql.java │ └── package-info.java ├── legacy └── java │ └── com │ └── mysql │ └── jdbc │ ├── Driver.java │ ├── SocketFactory.java │ └── SocketFactoryWrapper.java ├── main ├── core-api │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ ├── BindValue.java │ │ ├── CacheAdapter.java │ │ ├── CacheAdapterFactory.java │ │ ├── CancelQueryTask.java │ │ ├── CharsetMapping.java │ │ ├── CharsetSettings.java │ │ ├── Constants.java │ │ ├── DataStoreMetadata.java │ │ ├── MessageBuilder.java │ │ ├── Messages.java │ │ ├── MysqlConnection.java │ │ ├── MysqlType.java │ │ ├── PerConnectionLRUFactory.java │ │ ├── PingTarget.java │ │ ├── PlaceholderPurpose.java │ │ ├── PreparedQuery.java │ │ ├── Query.java │ │ ├── QueryAttributesBindings.java │ │ ├── QueryBindings.java │ │ ├── QueryInfo.java │ │ ├── QueryResult.java │ │ ├── QueryReturnType.java │ │ ├── ServerVersion.java │ │ ├── Session.java │ │ ├── TransactionEventHandler.java │ │ ├── WarningListener.java │ │ ├── callback │ │ ├── MysqlCallback.java │ │ ├── MysqlCallbackHandler.java │ │ ├── OpenidConnectAuthenticationCallback.java │ │ ├── OpenidConnectIdTokenFromFileCallbackHandler.java │ │ ├── UsernameCallback.java │ │ └── WebAuthnAuthenticationCallback.java │ │ ├── conf │ │ ├── ConnectionPropertiesTransform.java │ │ ├── ConnectionUrl.java │ │ ├── ConnectionUrlParser.java │ │ ├── DatabaseUrlContainer.java │ │ ├── HostInfo.java │ │ ├── HostsListView.java │ │ ├── PropertyDefinition.java │ │ ├── PropertyDefinitions.java │ │ ├── PropertyKey.java │ │ ├── PropertySet.java │ │ └── RuntimeProperty.java │ │ ├── exceptions │ │ ├── AssertionFailedException.java │ │ ├── CJCommunicationsException.java │ │ ├── CJConnectionFeatureNotAvailableException.java │ │ ├── CJException.java │ │ ├── CJOperationNotSupportedException.java │ │ ├── CJPacketTooBigException.java │ │ ├── CJTimeoutException.java │ │ ├── ClosedOnExpiredPasswordException.java │ │ ├── ConnectionIsClosedException.java │ │ ├── DataConversionException.java │ │ ├── DataReadException.java │ │ ├── DataTruncationException.java │ │ ├── DeadlockTimeoutRollbackMarker.java │ │ ├── ExceptionFactory.java │ │ ├── ExceptionInterceptor.java │ │ ├── ExceptionInterceptorChain.java │ │ ├── FeatureNotAvailableException.java │ │ ├── InvalidConnectionAttributeException.java │ │ ├── MysqlErrorNumbers.java │ │ ├── NumberOutOfRange.java │ │ ├── OperationCancelledException.java │ │ ├── PasswordExpiredException.java │ │ ├── PropertyNotModifiableException.java │ │ ├── RSAException.java │ │ ├── SSLParamsException.java │ │ ├── StatementIsClosedException.java │ │ ├── StreamingNotifiable.java │ │ ├── UnableToConnectException.java │ │ ├── UnsupportedConnectionStringException.java │ │ └── WrongArgumentException.java │ │ ├── interceptors │ │ └── QueryInterceptor.java │ │ ├── log │ │ ├── Jdk14Logger.java │ │ ├── Log.java │ │ ├── NullLogger.java │ │ ├── ProfilerEvent.java │ │ ├── ProfilerEventHandler.java │ │ ├── Slf4JLogger.java │ │ └── StandardLogger.java │ │ ├── protocol │ │ ├── AuthenticationPlugin.java │ │ ├── AuthenticationProvider.java │ │ ├── ColumnDefinition.java │ │ ├── FullReadInputStream.java │ │ ├── InternalDate.java │ │ ├── InternalTime.java │ │ ├── InternalTimestamp.java │ │ ├── Message.java │ │ ├── MessageHeader.java │ │ ├── MessageListener.java │ │ ├── MessageReader.java │ │ ├── MessageSender.java │ │ ├── NetworkResources.java │ │ ├── OutputStreamWatcher.java │ │ ├── PacketReceivedTimeHolder.java │ │ ├── PacketSentTimeHolder.java │ │ ├── Protocol.java │ │ ├── ProtocolEntity.java │ │ ├── ProtocolEntityFactory.java │ │ ├── ProtocolEntityReader.java │ │ ├── ResultBuilder.java │ │ ├── ResultStreamer.java │ │ ├── Resultset.java │ │ ├── ResultsetRow.java │ │ ├── ResultsetRows.java │ │ ├── ResultsetRowsOwner.java │ │ ├── ServerCapabilities.java │ │ ├── ServerSession.java │ │ ├── ServerSessionStateController.java │ │ ├── SocketConnection.java │ │ ├── SocketFactory.java │ │ ├── SocketMetadata.java │ │ ├── ValueDecoder.java │ │ ├── ValueEncoder.java │ │ ├── Warning.java │ │ └── WatchableStream.java │ │ ├── result │ │ ├── Field.java │ │ ├── Row.java │ │ ├── RowList.java │ │ └── ValueFactory.java │ │ ├── telemetry │ │ ├── NoopTelemetryHandler.java │ │ ├── NoopTelemetryScope.java │ │ ├── NoopTelemetrySpan.java │ │ ├── TelemetryAttribute.java │ │ ├── TelemetryHandler.java │ │ ├── TelemetryScope.java │ │ ├── TelemetrySpan.java │ │ └── TelemetrySpanName.java │ │ └── util │ │ ├── Base64Decoder.java │ │ ├── DataTypeUtil.java │ │ ├── DnsSrv.java │ │ ├── EscapeTokenizer.java │ │ ├── LRUCache.java │ │ ├── LazyString.java │ │ ├── LogUtils.java │ │ ├── PerVmServerConfigCacheFactory.java │ │ ├── SaslPrep.java │ │ ├── SearchMode.java │ │ ├── SequentialIdLease.java │ │ ├── StringInspector.java │ │ ├── StringUtils.java │ │ ├── TestUtils.java │ │ ├── TimeUtil.java │ │ └── Util.java ├── core-impl │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ ├── AbstractQuery.java │ │ ├── CancelQueryTaskImpl.java │ │ ├── ClientPreparedQuery.java │ │ ├── CoreSession.java │ │ ├── DataStoreMetadataImpl.java │ │ ├── LicenseConfiguration.java │ │ ├── MysqlxSession.java │ │ ├── NativeCharsetSettings.java │ │ ├── NativeQueryAttributesBindings.java │ │ ├── NativeQueryBindValue.java │ │ ├── NativeQueryBindings.java │ │ ├── NativeSession.java │ │ ├── NoSubInterceptorWrapper.java │ │ ├── ServerPreparedQuery.java │ │ ├── ServerPreparedQueryTestcaseGenerator.java │ │ ├── SimpleQuery.java │ │ ├── admin │ │ └── ServerController.java │ │ ├── conf │ │ ├── AbstractPropertyDefinition.java │ │ ├── AbstractRuntimeProperty.java │ │ ├── BooleanProperty.java │ │ ├── BooleanPropertyDefinition.java │ │ ├── DefaultPropertySet.java │ │ ├── EnumProperty.java │ │ ├── EnumPropertyDefinition.java │ │ ├── IntegerProperty.java │ │ ├── IntegerPropertyDefinition.java │ │ ├── LongProperty.java │ │ ├── LongPropertyDefinition.java │ │ ├── MemorySizeProperty.java │ │ ├── MemorySizePropertyDefinition.java │ │ ├── StringProperty.java │ │ ├── StringPropertyDefinition.java │ │ └── url │ │ │ ├── FailoverConnectionUrl.java │ │ │ ├── FailoverDnsSrvConnectionUrl.java │ │ │ ├── LoadBalanceConnectionUrl.java │ │ │ ├── LoadBalanceDnsSrvConnectionUrl.java │ │ │ ├── ReplicationConnectionUrl.java │ │ │ ├── ReplicationDnsSrvConnectionUrl.java │ │ │ ├── SingleConnectionUrl.java │ │ │ ├── XDevApiConnectionUrl.java │ │ │ └── XDevApiDnsSrvConnectionUrl.java │ │ ├── log │ │ ├── BaseMetricsHolder.java │ │ ├── LogFactory.java │ │ ├── LoggingProfilerEventHandler.java │ │ └── ProfilerEventImpl.java │ │ ├── otel │ │ ├── OpenTelemetryHandler.java │ │ ├── OpenTelemetryScope.java │ │ └── OpenTelemetrySpan.java │ │ ├── protocol │ │ ├── AbstractProtocol.java │ │ ├── AbstractSocketConnection.java │ │ ├── ExportControlled.java │ │ ├── NamedPipeSocketFactory.java │ │ ├── ReadAheadInputStream.java │ │ ├── Security.java │ │ ├── SocksProxySocketFactory.java │ │ ├── StandardSocketFactory.java │ │ ├── WatchableOutputStream.java │ │ ├── WatchableWriter.java │ │ ├── WriterWatcher.java │ │ └── result │ │ │ └── AbstractResultsetRow.java │ │ ├── result │ │ ├── AbstractDateTimeValueFactory.java │ │ ├── AbstractNumericValueFactory.java │ │ ├── BigDecimalValueFactory.java │ │ ├── BinaryStreamValueFactory.java │ │ ├── BooleanValueFactory.java │ │ ├── BufferedRowList.java │ │ ├── ByteValueFactory.java │ │ ├── DefaultColumnDefinition.java │ │ ├── DefaultValueFactory.java │ │ ├── DoubleValueFactory.java │ │ ├── DurationValueFactory.java │ │ ├── FloatValueFactory.java │ │ ├── IntegerValueFactory.java │ │ ├── LocalDateTimeValueFactory.java │ │ ├── LocalDateValueFactory.java │ │ ├── LocalTimeValueFactory.java │ │ ├── LongValueFactory.java │ │ ├── OffsetDateTimeValueFactory.java │ │ ├── OffsetTimeValueFactory.java │ │ ├── ShortValueFactory.java │ │ ├── SqlDateValueFactory.java │ │ ├── SqlTimeValueFactory.java │ │ ├── SqlTimestampValueFactory.java │ │ ├── StringValueFactory.java │ │ ├── UtilCalendarValueFactory.java │ │ └── ZonedDateTimeValueFactory.java │ │ └── sasl │ │ ├── ScramSha1SaslClient.java │ │ ├── ScramSha256SaslClient.java │ │ ├── ScramShaSaslClient.java │ │ ├── ScramShaSaslClientFactory.java │ │ └── ScramShaSaslProvider.java ├── doc │ ├── connector-j-overview.html │ └── mysqlx-overview.html ├── protocol-impl │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ └── protocol │ │ ├── a │ │ ├── AbstractRowFactory.java │ │ ├── AbstractValueEncoder.java │ │ ├── BinaryResultsetReader.java │ │ ├── BinaryRowFactory.java │ │ ├── BlobValueEncoder.java │ │ ├── BooleanValueEncoder.java │ │ ├── ByteArrayValueEncoder.java │ │ ├── ClobValueEncoder.java │ │ ├── ColumnDefinitionFactory.java │ │ ├── ColumnDefinitionReader.java │ │ ├── CompressedInputStream.java │ │ ├── CompressedPacketSender.java │ │ ├── DebugBufferingPacketReader.java │ │ ├── DebugBufferingPacketSender.java │ │ ├── DurationValueEncoder.java │ │ ├── InputStreamValueEncoder.java │ │ ├── InstantValueEncoder.java │ │ ├── LocalDateTimeValueEncoder.java │ │ ├── LocalDateValueEncoder.java │ │ ├── LocalTimeValueEncoder.java │ │ ├── MergingColumnDefinitionFactory.java │ │ ├── MultiPacketReader.java │ │ ├── MysqlBinaryValueDecoder.java │ │ ├── MysqlTextValueDecoder.java │ │ ├── NativeAuthenticationProvider.java │ │ ├── NativeCapabilities.java │ │ ├── NativeConstants.java │ │ ├── NativeMessageBuilder.java │ │ ├── NativePacketHeader.java │ │ ├── NativePacketPayload.java │ │ ├── NativeProtocol.java │ │ ├── NativeServerSession.java │ │ ├── NativeServerSessionStateController.java │ │ ├── NativeSocketConnection.java │ │ ├── NativeUtils.java │ │ ├── NullValueEncoder.java │ │ ├── NumberValueEncoder.java │ │ ├── OffsetDateTimeValueEncoder.java │ │ ├── OffsetTimeValueEncoder.java │ │ ├── PacketSplitter.java │ │ ├── ReaderValueEncoder.java │ │ ├── ResultsetFactory.java │ │ ├── ResultsetRowReader.java │ │ ├── SimplePacketReader.java │ │ ├── SimplePacketSender.java │ │ ├── SqlDateValueEncoder.java │ │ ├── SqlTimeValueEncoder.java │ │ ├── SqlTimestampValueEncoder.java │ │ ├── StringValueEncoder.java │ │ ├── TextResultsetReader.java │ │ ├── TextRowFactory.java │ │ ├── TimeTrackingPacketReader.java │ │ ├── TimeTrackingPacketSender.java │ │ ├── TracingPacketReader.java │ │ ├── TracingPacketSender.java │ │ ├── UtilCalendarValueEncoder.java │ │ ├── UtilDateValueEncoder.java │ │ ├── ZonedDateTimeValueEncoder.java │ │ ├── authentication │ │ │ ├── AuthenticationKerberosClient.java │ │ │ ├── AuthenticationLdapSaslClientPlugin.java │ │ │ ├── AuthenticationOciClient.java │ │ │ ├── AuthenticationOpenidConnectClient.java │ │ │ ├── AuthenticationWebAuthnClient.java │ │ │ ├── CachingSha2PasswordPlugin.java │ │ │ ├── MysqlClearPasswordPlugin.java │ │ │ ├── MysqlNativePasswordPlugin.java │ │ │ ├── MysqlOldPasswordPlugin.java │ │ │ └── Sha256PasswordPlugin.java │ │ └── result │ │ │ ├── AbstractBufferRow.java │ │ │ ├── AbstractResultsetRows.java │ │ │ ├── BinaryBufferRow.java │ │ │ ├── ByteArrayRow.java │ │ │ ├── NativeResultset.java │ │ │ ├── OkPacket.java │ │ │ ├── ResultsetRowsCursor.java │ │ │ ├── ResultsetRowsStatic.java │ │ │ ├── ResultsetRowsStreaming.java │ │ │ └── TextBufferRow.java │ │ └── x │ │ ├── CompressionAlgorithm.java │ │ ├── CompressionMode.java │ │ ├── CompressionSplittedInputStream.java │ │ ├── CompressionSplittedOutputStream.java │ │ ├── CompressorStreamsFactory.java │ │ ├── ConfinedInputStream.java │ │ ├── ContinuousInputStream.java │ │ ├── ContinuousOutputStream.java │ │ ├── ErrorToFutureCompletionHandler.java │ │ ├── FetchDoneEntity.java │ │ ├── FetchDoneEntityFactory.java │ │ ├── FetchDoneMoreResults.java │ │ ├── FetchDoneMoreResultsFactory.java │ │ ├── FieldFactory.java │ │ ├── MessageConstants.java │ │ ├── Notice.java │ │ ├── NoticeFactory.java │ │ ├── Ok.java │ │ ├── OkBuilder.java │ │ ├── OkFactory.java │ │ ├── ResultMessageListener.java │ │ ├── ReusableOutputStream.java │ │ ├── StatementExecuteOk.java │ │ ├── StatementExecuteOkBuilder.java │ │ ├── StatementExecuteOkFactory.java │ │ ├── SyncFlushDeflaterOutputStream.java │ │ ├── SyncMessageReader.java │ │ ├── SyncMessageSender.java │ │ ├── XAuthenticationProvider.java │ │ ├── XMessage.java │ │ ├── XMessageBuilder.java │ │ ├── XMessageHeader.java │ │ ├── XProtocol.java │ │ ├── XProtocolDecoder.java │ │ ├── XProtocolError.java │ │ ├── XProtocolRow.java │ │ ├── XProtocolRowFactory.java │ │ ├── XProtocolRowInputStream.java │ │ ├── XServerCapabilities.java │ │ ├── XServerSession.java │ │ └── XpluginStatementCommand.java ├── resources │ └── com │ │ └── mysql │ │ └── cj │ │ ├── LocalizedErrorMessages.properties │ │ ├── TlsSettings.properties │ │ ├── configurations │ │ ├── 3-0-Compat.properties │ │ ├── clusterBase.properties │ │ ├── coldFusion.properties │ │ ├── fullDebug.properties │ │ ├── maxPerformance-8-0.properties │ │ ├── maxPerformance.properties │ │ └── solarisMaxPerformance.properties │ │ └── util │ │ └── TimeZoneMapping.properties ├── user-api │ └── java │ │ └── com │ │ └── mysql │ │ └── cj │ │ ├── jdbc │ │ ├── ClientInfoProvider.java │ │ ├── CloseOption.java │ │ ├── JdbcConnection.java │ │ ├── JdbcPreparedStatement.java │ │ ├── JdbcPropertySet.java │ │ ├── JdbcStatement.java │ │ ├── ParameterBindings.java │ │ ├── ha │ │ │ ├── BalanceStrategy.java │ │ │ ├── LoadBalanceExceptionChecker.java │ │ │ ├── LoadBalancedConnection.java │ │ │ └── ReplicationConnection.java │ │ ├── interceptors │ │ │ └── ConnectionLifecycleInterceptor.java │ │ └── result │ │ │ ├── CachedResultSetMetaData.java │ │ │ └── ResultSetInternalMethods.java │ │ └── xdevapi │ │ ├── AddResult.java │ │ ├── AddStatement.java │ │ ├── Client.java │ │ ├── ClientFactory.java │ │ ├── Collection.java │ │ ├── Column.java │ │ ├── DatabaseObject.java │ │ ├── DbDoc.java │ │ ├── DeleteStatement.java │ │ ├── DocResult.java │ │ ├── Expression.java │ │ ├── FetchResult.java │ │ ├── FilterParams.java │ │ ├── FindStatement.java │ │ ├── InsertResult.java │ │ ├── InsertStatement.java │ │ ├── JsonValue.java │ │ ├── ModifyStatement.java │ │ ├── RemoveStatement.java │ │ ├── Result.java │ │ ├── Row.java │ │ ├── RowResult.java │ │ ├── Schema.java │ │ ├── SelectStatement.java │ │ ├── Session.java │ │ ├── SessionFactory.java │ │ ├── SqlResult.java │ │ ├── SqlStatement.java │ │ ├── Statement.java │ │ ├── Table.java │ │ ├── Type.java │ │ ├── UpdateStatement.java │ │ ├── UpdateType.java │ │ ├── Warning.java │ │ ├── XDevAPIError.java │ │ └── package-info.java └── user-impl │ └── java │ └── com │ └── mysql │ └── cj │ ├── jdbc │ ├── AbandonedConnectionCleanupThread.java │ ├── Blob.java │ ├── BlobFromLocator.java │ ├── CallableStatement.java │ ├── CallableStatementWrapper.java │ ├── ClientInfoProviderSP.java │ ├── ClientPreparedStatement.java │ ├── Clob.java │ ├── CommentClientInfoProvider.java │ ├── ConnectionGroup.java │ ├── ConnectionGroupManager.java │ ├── ConnectionImpl.java │ ├── ConnectionWrapper.java │ ├── DatabaseMetaData.java │ ├── DatabaseMetaDataInformationSchema.java │ ├── DatabaseMetaDataMysqlSchema.java │ ├── Driver.java │ ├── EscapeProcessor.java │ ├── EscapeProcessorResult.java │ ├── IterateBlock.java │ ├── JdbcPropertySetImpl.java │ ├── MysqlConnectionPoolDataSource.java │ ├── MysqlDataSource.java │ ├── MysqlDataSourceFactory.java │ ├── MysqlParameterMetadata.java │ ├── MysqlPooledConnection.java │ ├── MysqlSQLXML.java │ ├── MysqlSavepoint.java │ ├── MysqlXAConnection.java │ ├── MysqlXADataSource.java │ ├── MysqlXAException.java │ ├── MysqlXid.java │ ├── NClob.java │ ├── NonRegisteringDriver.java │ ├── ParameterBindingsImpl.java │ ├── PreparedStatementWrapper.java │ ├── ServerPreparedStatement.java │ ├── StatementImpl.java │ ├── StatementWrapper.java │ ├── SuspendableXAConnection.java │ ├── WrapperBase.java │ ├── admin │ │ └── MiniAdmin.java │ ├── exceptions │ │ ├── CommunicationsException.java │ │ ├── ConnectionFeatureNotAvailableException.java │ │ ├── MySQLQueryInterruptedException.java │ │ ├── MySQLStatementCancelledException.java │ │ ├── MySQLTimeoutException.java │ │ ├── MySQLTransactionRollbackException.java │ │ ├── MysqlDataTruncation.java │ │ ├── NotUpdatable.java │ │ ├── OperationNotSupportedException.java │ │ ├── PacketTooBigException.java │ │ ├── SQLError.java │ │ └── SQLExceptionsMapping.java │ ├── ha │ │ ├── BestResponseTimeBalanceStrategy.java │ │ ├── FailoverConnectionProxy.java │ │ ├── LoadBalancedAutoCommitInterceptor.java │ │ ├── LoadBalancedConnectionProxy.java │ │ ├── LoadBalancedMySQLConnection.java │ │ ├── MultiHostConnectionProxy.java │ │ ├── MultiHostMySQLConnection.java │ │ ├── NdbLoadBalanceExceptionChecker.java │ │ ├── RandomBalanceStrategy.java │ │ ├── ReplicationConnectionGroup.java │ │ ├── ReplicationConnectionGroupManager.java │ │ ├── ReplicationConnectionProxy.java │ │ ├── ReplicationMySQLConnection.java │ │ ├── SequentialBalanceStrategy.java │ │ ├── ServerAffinityStrategy.java │ │ └── StandardLoadBalanceExceptionChecker.java │ ├── integration │ │ └── c3p0 │ │ │ └── MysqlConnectionTester.java │ ├── interceptors │ │ ├── ResultSetScannerInterceptor.java │ │ ├── ServerStatusDiffInterceptor.java │ │ └── SessionAssociationInterceptor.java │ ├── jmx │ │ ├── LoadBalanceConnectionGroupManager.java │ │ ├── LoadBalanceConnectionGroupManagerMBean.java │ │ ├── ReplicationGroupManager.java │ │ └── ReplicationGroupManagerMBean.java │ ├── result │ │ ├── CachedResultSetMetaDataImpl.java │ │ ├── ResultSetFactory.java │ │ ├── ResultSetImpl.java │ │ ├── ResultSetMetaData.java │ │ └── UpdatableResultSet.java │ └── util │ │ └── BaseBugReport.java │ └── xdevapi │ ├── AbstractDataResult.java │ ├── AbstractFilterParams.java │ ├── AddResultBuilder.java │ ├── AddResultImpl.java │ ├── AddStatementImpl.java │ ├── ClientImpl.java │ ├── CollectionImpl.java │ ├── ColumnImpl.java │ ├── CreateIndexParams.java │ ├── DatabaseObjectDescription.java │ ├── DbDocFactory.java │ ├── DbDocImpl.java │ ├── DbDocValueFactory.java │ ├── DeleteStatementImpl.java │ ├── DocFilterParams.java │ ├── DocResultBuilder.java │ ├── DocResultImpl.java │ ├── ExprParser.java │ ├── ExprUnparser.java │ ├── ExprUtil.java │ ├── FilterableStatement.java │ ├── FindStatementImpl.java │ ├── InsertParams.java │ ├── InsertResultBuilder.java │ ├── InsertResultImpl.java │ ├── InsertStatementImpl.java │ ├── JsonArray.java │ ├── JsonLiteral.java │ ├── JsonNumber.java │ ├── JsonParser.java │ ├── JsonString.java │ ├── ModifyStatementImpl.java │ ├── PreparableStatement.java │ ├── RemoveStatementImpl.java │ ├── RowFactory.java │ ├── RowImpl.java │ ├── RowResultBuilder.java │ ├── RowResultImpl.java │ ├── SchemaImpl.java │ ├── SelectStatementImpl.java │ ├── SessionImpl.java │ ├── SqlMultiResult.java │ ├── SqlResultBuilder.java │ ├── SqlSingleResult.java │ ├── SqlStatementImpl.java │ ├── SqlUpdateResult.java │ ├── StreamingDocResultBuilder.java │ ├── StreamingRowResultBuilder.java │ ├── StreamingSqlResultBuilder.java │ ├── TableFilterParams.java │ ├── TableImpl.java │ ├── UpdateParams.java │ ├── UpdateResult.java │ ├── UpdateResultBuilder.java │ ├── UpdateSpec.java │ ├── UpdateStatementImpl.java │ └── WarningImpl.java └── test ├── config └── ssl-test-certs │ ├── ca-cert-ext.pem │ ├── ca-cert.pem │ ├── ca-key-ext.pem │ ├── ca-key.pem │ ├── ca-truststore │ ├── ca-truststore-ext │ ├── certs_howto.txt │ ├── client-cert-ext.pem │ ├── client-cert.pem │ ├── client-key-ext.pem │ ├── client-key.pem │ ├── client-keystore │ ├── client-keystore-ext │ ├── mykey.pem │ ├── mykey.pub │ ├── server-cert-ext.pem │ ├── server-cert.pem │ ├── server-key-ext.pem │ └── server-key.pem └── java ├── com └── mysql │ └── cj │ ├── CharsetMappingWrapper.java │ ├── ConnectionUrlTest.java │ ├── MessagesTest.java │ ├── ServerVersionTest.java │ ├── protocol │ ├── a │ │ ├── CompressedPacketSenderTest.java │ │ ├── DebugBufferingPacketSenderTest.java │ │ ├── MysqlBinaryValueDecoderTest.java │ │ ├── MysqlTextValueDecoderTest.java │ │ ├── PacketSenderTestBase.java │ │ ├── SimplePacketReaderTest.java │ │ └── SimplePacketSenderTest.java │ └── x │ │ ├── CompressionTest.java │ │ ├── SyncMessageReaderTest.java │ │ └── SyncMessageWriterTest.java │ ├── result │ ├── BigDecimalValueFactoryTest.java │ ├── BinaryStreamValueFactoryTest.java │ ├── BooleanValueFactoryTest.java │ ├── ByteValueFactoryTest.java │ ├── CommonAsserts.java │ ├── DoubleValueFactoryTest.java │ ├── FloatValueFactoryTest.java │ ├── IntegerValueFactoryTest.java │ ├── LocalDateTimeValueFactoryTest.java │ ├── LocalDateValueFactoryTest.java │ ├── LocalTimeValueFactoryTest.java │ ├── LongValueFactoryTest.java │ ├── ShortValueFactoryTest.java │ ├── SqlDateValueFactoryTest.java │ ├── SqlTimeValueFactoryTest.java │ ├── SqlTimestampValueFactoryTest.java │ ├── StringValueFactoryTest.java │ └── ZeroDateTimeToNullValueFactoryTest.java │ ├── util │ ├── StringInspectorTest.java │ ├── StringUtilsTest.java │ └── TimeUtilTest.java │ └── xdevapi │ ├── ExprParserTest.java │ └── JsonDocTest.java └── testsuite ├── BaseQueryInterceptor.java ├── BaseTestCase.java ├── BufferingLogger.java ├── InjectedSocketFactory.java ├── JUnitSummary.java ├── MockJndiContextFactory.java ├── TestUtils.java ├── UnreliableSocketFactory.java ├── perf ├── BasePerfTest.java ├── LoadStorePerfTest.java └── RetrievalPerfTest.java ├── regression ├── BlobRegressionTest.java ├── CachedRowsetTest.java ├── CallableStatementRegressionTest.java ├── CharsetRegressionTest.java ├── ConnectionRegressionTest.java ├── DataSourceRegressionTest.java ├── DateTimeRegressionTest.java ├── EscapeProcessorRegressionTest.java ├── ExceptionSubclassesTest.java ├── MetaDataRegressionTest.java ├── MicroPerformanceRegressionTest.java ├── NonLocalSocketFactory.java ├── NumbersRegressionTest.java ├── PooledConnectionRegressionTest.java ├── ResultSetRegressionTest.java ├── StatementRegressionTest.java ├── StressRegressionTest.java ├── StringRegressionTest.java ├── SubqueriesRegressionTest.java ├── SyntaxRegressionTest.java └── UtilsRegressionTest.java ├── simple ├── AuthenticationTest.java ├── BlobTest.java ├── CallableStatementTest.java ├── CharsetTest.java ├── ConnectionTest.java ├── DataSourceTest.java ├── DateTest.java ├── DateTimeTest.java ├── EscapeProcessingTest.java ├── ExceptionsTest.java ├── MetaDataTest.java ├── MiniAdminTest.java ├── MultiHostConnectionTest.java ├── NumbersTest.java ├── QueryAttributesTest.java ├── ReadOnlyCallableStatementTest.java ├── ResultSetTest.java ├── SaslPrepTest.java ├── SecureConnectionTest.java ├── SequentialIdLeaseTest.java ├── ServerControllerTest.java ├── SimpleTransformer.java ├── SplitDBdotNameTest.java ├── StatementsTest.java ├── TestLifecycleInterceptor.java ├── TransactionTest.java ├── TraversalTest.java ├── UpdatabilityTest.java ├── UtilsTest.java └── XATest.java └── x ├── devapi ├── AsyncQueryTest.java ├── BaseCollectionTestCase.java ├── BaseTableTestCase.java ├── BindTest.java ├── CollectionAddTest.java ├── CollectionFindTest.java ├── CollectionModifyTest.java ├── CollectionRemoveTest.java ├── CollectionTest.java ├── CompressionTest.java ├── DevApiBaseTestCase.java ├── Ipv6SupportTest.java ├── MetadataTest.java ├── ResultTest.java ├── RowLockingTest.java ├── SchemaTest.java ├── SecureSessionTest.java ├── SessionFailoverTest.java ├── SessionTest.java ├── TableDeleteTest.java ├── TableInsertTest.java ├── TableSelectTest.java ├── TableTest.java ├── TableUpdateTest.java ├── TransactionTest.java └── package-info.java └── internal ├── InternalXBaseTestCase.java ├── MysqlxSessionTest.java ├── XProtocolAsyncTest.java ├── XProtocolAuthTest.java ├── XProtocolTest.java └── package-info.java /.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /build/ 3 | /buildtest/ 4 | /dist/ 5 | /docs/ 6 | /nbproject/ 7 | /patches/ 8 | /*.properties 9 | *~ 10 | *.lock 11 | *.swp 12 | *.DS_Store 13 | *.diff 14 | *.dot 15 | *.dot.png 16 | *.class 17 | .project.el 18 | .attach_pid* 19 | hs_err_pid*.log 20 | *.sh 21 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConnectorJ 9x 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | 19 | 1687523287226 20 | 21 | 26 22 | 23 | org.eclipse.ui.ide.multiFilter 24 | 1.0-projectRelativePath-matches-false-false-build 25 | 26 | 27 | 28 | 1687523287234 29 | 30 | 26 31 | 32 | org.eclipse.ui.ide.multiFilter 33 | 1.0-projectRelativePath-matches-false-false-dist 34 | 35 | 36 | 37 | 1687523287240 38 | 39 | 26 40 | 41 | org.eclipse.ui.ide.multiFilter 42 | 1.0-projectRelativePath-matches-false-false-buildtest 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | #Mon Oct 20 17:22:34 CDT 2008 2 | eclipse.preferences.version=1 3 | encoding/=UTF-8 4 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.launching.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.xsl.core.prefs: -------------------------------------------------------------------------------- 1 | CHECK_CALL_TEMPLATES=2 2 | CHECK_XPATHS=2 3 | CIRCULAR_REF=2 4 | DUPLICATE_PARAMETER=2 5 | EMPTY_PARAM=1 6 | MISSING_INCLUDE=2 7 | MISSING_PARAM=1 8 | NAME_ATTRIBUTE_EMPTY=2 9 | NAME_ATTRIBUTE_MISSING=2 10 | TEMPLATE_CONFLICT=2 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting security vulnerabilities 2 | 3 | Oracle values the independent security research community and believes that 4 | responsible disclosure of security vulnerabilities helps us ensure the security 5 | and privacy of all our users. 6 | 7 | Please do NOT raise a GitHub Issue to report a security vulnerability. If you 8 | believe you have found a security vulnerability, please submit a report to 9 | secalert_us@oracle.com preferably with a proof of concept. Please review some 10 | additional information [on how to report security vulnerabilities to Oracle](https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html). 11 | We encourage people who contact Oracle Security to use email encryption using 12 | our [encryption key](https://www.oracle.com/security-alerts/encryptionkey.html). 13 | 14 | We ask that you do not use other channels or contact the project maintainers 15 | directly. 16 | 17 | # Security updates, alerts and bulletins 18 | 19 | Security updates will be released on a regular cadence. Many of our projects 20 | will typically release security fixes in conjunction with the Oracle Critical 21 | Patch Update program. Additional information, including past advisories, is 22 | available on our [security alerts page](https://www.oracle.com/security-alerts/). 23 | 24 | # Security-related information 25 | 26 | We will provide security related information such as a threat model, 27 | considerations for secure use, or any known security issues in our 28 | documentation. Please note that labs and sample code are intended to demonstrate 29 | a concept and may not be sufficiently hardened for production use. 30 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/changelog: -------------------------------------------------------------------------------- 1 | @PRODUCT_NAME@@PACKAGE_SUFFIX@ (@MYSQL_CJ_VERSION@@MYSQL_CJ_VERSION_SNAPSHOT@@DEB_VERSION_SUFFIX@@ID_RELEASE@) @CODENAME@; urgency=low 2 | 3 | * For release notes, please refer to https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/ 4 | 5 | -- @MAINTAINER_EMAIL@ @PACKAGE_TIMESTAMP@ 6 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/control: -------------------------------------------------------------------------------- 1 | Source: @PRODUCT_NAME@@PACKAGE_SUFFIX@ 2 | Section: database 3 | Priority: optional 4 | Maintainer: Oracle MySQL Product Engineering Team 5 | Standards-Version: 3.9.2 6 | Build-Depends: debhelper (>= 11) 7 | Homepage: http://dev.mysql.com/downloads/connector/j/ 8 | 9 | Package: @PRODUCT_NAME@@PACKAGE_SUFFIX@ 10 | Section: database 11 | Architecture: all 12 | Depends: ${shlibs:Depends}, ${misc:Depends} 13 | Replaces: @PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@ (<< 8.0.31) 14 | Breaks: @PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@ (<< 8.0.31) 15 | Provides: @PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@ 16 | Description: MySQL Connector/J 17 | Standardized MySQL database driver for Java 18 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: @PRODUCT@ 3 | Upstream-Contact: MySQL Release Engineering 4 | Source: http://dev.mysql.com/ 5 | 6 | Files: * 7 | Copyright: 2002, 2025, Oracle and/or its affiliates. 8 | License: 9 | For licensing information see the LICENSE file in this distribution. 10 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/install: -------------------------------------------------------------------------------- 1 | @DIR_PACKAGE@/@PRODUCT_NAME@-@VERSION_FULL@.jar usr/share/java 2 | 3 | #legal 4 | @DIR_PACKAGE@/@LIC_FILE@ usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 5 | @DIR_PACKAGE@/README usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 6 | @DIR_PACKAGE@/CHANGES usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 7 | @DIR_PACKAGE@/INFO_SRC usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 8 | @DIR_PACKAGE@/INFO_BIN usr/share/doc/@PRODUCT_NAME@@PACKAGE_SUFFIX@ 9 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/links: -------------------------------------------------------------------------------- 1 | usr/share/java/@PRODUCT_NAME@-@VERSION_FULL@.jar usr/share/java/@PRODUCT_LEGACY_NAME@@PACKAGE_SUFFIX@-@VERSION_FULL@.jar 2 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /src/build/misc/debian.in/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | http://mysql.osuosl.org/Downloads/@PRODUCT_NAME@-(.+)\.tar\.gz 3 | -------------------------------------------------------------------------------- /src/generated/java/com/mysql/cj/x/protobuf/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * Message classes used for serialization with Google Protocol Buffers to support the X Protocol. Classes are generated using protoc like so: 23 | * 24 | *
25 |  * protoc --java_out=PATH/src/generated/java --proto_path=PATH_TO_IMPORTS -I=PATH_TO_MYSQL_REPO/rapid/plugin/x/protocol PATH_TO_MYSQL_REPO/rapid/plugin/x/protocol/*.proto
26 |  * 
27 | * 28 | * @since 6.0 29 | */ 30 | 31 | package com.mysql.cj.x.protobuf; 32 | -------------------------------------------------------------------------------- /src/legacy/java/com/mysql/jdbc/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.jdbc; 22 | 23 | import java.sql.SQLException; 24 | 25 | /** 26 | * Backwards compatibility to support apps that call Class.forName("com.mysql.jdbc.Driver");. 27 | */ 28 | public class Driver extends com.mysql.cj.jdbc.Driver { 29 | 30 | public Driver() throws SQLException { 31 | super(); 32 | } 33 | 34 | static { 35 | System.err.println("Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. " 36 | + "The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary."); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/CacheAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | import java.util.Set; 24 | 25 | public interface CacheAdapter { 26 | 27 | V get(K key); 28 | 29 | void put(K key, V value); 30 | 31 | void invalidate(K key); 32 | 33 | void invalidateAll(Set keys); 34 | 35 | void invalidateAll(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/CacheAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | import java.util.concurrent.locks.Lock; 24 | 25 | public interface CacheAdapterFactory { 26 | 27 | CacheAdapter getInstance(Lock lock, String url, int cacheMaxSize, int maxKeySize); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/CancelQueryTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | public interface CancelQueryTask { 24 | 25 | boolean cancel(); 26 | 27 | Throwable getCaughtWhileCancelling(); 28 | 29 | void setCaughtWhileCancelling(Throwable caughtWhileCancelling); 30 | 31 | Query getQueryToCancel(); 32 | 33 | void setQueryToCancel(Query queryToCancel); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/DataStoreMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | public interface DataStoreMetadata { 24 | 25 | boolean schemaExists(String schemaName); 26 | 27 | boolean tableExists(String schemaName, String tableName); 28 | 29 | long getTableRowCount(String schemaName, String tableName); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/MessageBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | import java.util.List; 24 | 25 | import com.mysql.cj.protocol.Message; 26 | 27 | public interface MessageBuilder { 28 | 29 | M buildSqlStatement(String statement); 30 | 31 | M buildSqlStatement(String statement, List args); 32 | 33 | M buildClose(); 34 | 35 | M buildComQuery(M sharedPacket, Session sess, String query, Query callingQuery, String characterEncoding); 36 | 37 | M buildComQuery(M sharedPacket, Session sess, PreparedQuery preparedQuery, QueryBindings bindings, String characterEncoding); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/PingTarget.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | public interface PingTarget { 24 | 25 | void doPing() throws Exception; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/PlaceholderPurpose.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | /** 24 | * The possible purposes for placeholders in queries. 25 | */ 26 | public enum PlaceholderPurpose { 27 | GENERIC, INSERT_VALUES, LIMIT_AND_OFFSET; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/QueryResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | public interface QueryResult { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/QueryReturnType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | /** 24 | * The possible return types from executing queries. 25 | */ 26 | public enum QueryReturnType { 27 | PRODUCES_RESULT_SET, MAY_PRODUCE_RESULT_SET, DOES_NOT_PRODUCE_RESULT_SET, NONE; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/TransactionEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | public interface TransactionEventHandler { 24 | 25 | void transactionBegun(); 26 | 27 | void transactionCompleted(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/WarningListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | /** 24 | * A warning listener is notified of warnings as they happen throughout the driver. They can be queued for consumption by JDBC clients, thrown as exceptions, or 25 | * ignored. 26 | */ 27 | public interface WarningListener { 28 | 29 | void warningEncountered(String warning); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/callback/MysqlCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.callback; 22 | 23 | /** 24 | * Implementations of this interface can be passed to a {@link MysqlCallbackHandler} so that the owner of the callback handler and its caller can share data in 25 | * a way that would otherwise require tighter coupling. 26 | */ 27 | public interface MysqlCallback { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/callback/UsernameCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.callback; 22 | 23 | /** 24 | * A callback that can be used to exchange username information to a callback handler owner. 25 | */ 26 | public class UsernameCallback implements MysqlCallback { 27 | 28 | private String username; 29 | 30 | public UsernameCallback(String username) { 31 | this.username = username; 32 | } 33 | 34 | /** 35 | * Get the username provided by the caller of {@link MysqlCallbackHandler#handle(MysqlCallback)}. 36 | * 37 | * @return 38 | * the username to pass over to the callback handler. 39 | */ 40 | public String getUsername() { 41 | return this.username; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/conf/DatabaseUrlContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.conf; 22 | 23 | /** 24 | * Implementors of this class must be able to provide a database URL. 25 | */ 26 | public interface DatabaseUrlContainer { 27 | 28 | /** 29 | * Returns the original database URL that produced this connection string. 30 | * 31 | * @return the original database URL 32 | */ 33 | String getDatabaseUrl(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/conf/HostsListView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.conf; 22 | 23 | /** 24 | * An enumeration that identifies the type of the view intended for getting hosts lists for multi-host connections. 25 | */ 26 | public enum HostsListView { 27 | ALL, SOURCES, REPLICAS; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/CJOperationNotSupportedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | public class CJOperationNotSupportedException extends CJException { 24 | 25 | private static final long serialVersionUID = 2619184100062994443L; 26 | 27 | public CJOperationNotSupportedException() { 28 | super(); 29 | } 30 | 31 | public CJOperationNotSupportedException(String message) { 32 | super(message); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/CJTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | import com.mysql.cj.Messages; 24 | 25 | public class CJTimeoutException extends CJException { 26 | 27 | private static final long serialVersionUID = -7440108828056331100L; 28 | 29 | public CJTimeoutException() { 30 | super(Messages.getString("MySQLTimeoutException.0")); 31 | } 32 | 33 | public CJTimeoutException(String message) { 34 | super(message); 35 | } 36 | 37 | public CJTimeoutException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public CJTimeoutException(String message, Throwable cause) { 42 | super(message, cause); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/DataConversionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | /** 24 | * Indicates that data could not be converted according to the given request. 25 | */ 26 | public class DataConversionException extends DataReadException { 27 | 28 | private static final long serialVersionUID = -863576663404236982L; 29 | 30 | public DataConversionException(String msg) { 31 | super(msg); 32 | setSQLState("22018"); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/DataReadException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | /** 24 | * Indicates that data could not be read according to the given request. 25 | */ 26 | public class DataReadException extends CJException { 27 | 28 | private static final long serialVersionUID = 1684265521187171525L; 29 | 30 | public DataReadException(Exception cause) { 31 | super(cause); 32 | setSQLState("S1009"); 33 | } 34 | 35 | public DataReadException(String msg) { 36 | super(msg); 37 | setSQLState("S1009"); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/DeadlockTimeoutRollbackMarker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | /** 24 | * Marker interface for exceptions that are caused by deadlock/wait timeout 25 | */ 26 | public interface DeadlockTimeoutRollbackMarker { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/NumberOutOfRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | /** 24 | * Indicates that a number was out of the expected range. 25 | */ 26 | public class NumberOutOfRange extends DataReadException { 27 | 28 | private static final long serialVersionUID = -61091413023651438L; 29 | 30 | public NumberOutOfRange(String msg) { 31 | super(msg); 32 | setSQLState("22003"); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/OperationCancelledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | import com.mysql.cj.Messages; 24 | 25 | public class OperationCancelledException extends CJException { 26 | 27 | private static final long serialVersionUID = 9001418688349454695L; 28 | 29 | public OperationCancelledException() { 30 | super(Messages.getString("MySQLStatementCancelledException.0")); 31 | } 32 | 33 | public OperationCancelledException(String message) { 34 | super(message); 35 | } 36 | 37 | public OperationCancelledException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | public OperationCancelledException(String message, Throwable cause) { 42 | super(message, cause); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/exceptions/StreamingNotifiable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.exceptions; 22 | 23 | public interface StreamingNotifiable { 24 | 25 | void setWasStreamingResults(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/log/ProfilerEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.log; 22 | 23 | import com.mysql.cj.Query; 24 | import com.mysql.cj.Session; 25 | import com.mysql.cj.protocol.Resultset; 26 | 27 | public interface ProfilerEventHandler { 28 | 29 | void init(Log log); 30 | 31 | void destroy(); 32 | 33 | void consumeEvent(ProfilerEvent evt); 34 | 35 | void processEvent(byte eventType, Session session, Query query, Resultset resultSet, long eventDuration, Throwable eventCreationPoint, String message); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/Message.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | /** 24 | * Message is the content of a full single message (native protocol packet or protobuf message), 25 | * independent from on-wire splitting, communicated with the server. 26 | */ 27 | public interface Message { 28 | 29 | /** 30 | * Returns the array of bytes this Buffer is using to read from. 31 | * 32 | * @return byte array being read from 33 | */ 34 | byte[] getByteBuffer(); 35 | 36 | /** 37 | * Returns the current position to write to/ read from 38 | * 39 | * @return the current position to write to/ read from 40 | */ 41 | int getPosition(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/MessageHeader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | import java.nio.ByteBuffer; 24 | 25 | /** 26 | * Represents the protocol specific message header 27 | */ 28 | public interface MessageHeader { 29 | 30 | ByteBuffer getBuffer(); 31 | 32 | int getMessageSize(); 33 | 34 | byte getMessageSequence(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/OutputStreamWatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | /** 24 | * Objects that want to be notified of lifecycle events on a WatchableOutputStream should implement this interface, and register themselves with setWatcher() 25 | * on the WatchableOutputStream instance. 26 | */ 27 | public interface OutputStreamWatcher { 28 | 29 | /** 30 | * Called when the OutputStream being watched has .close() called 31 | * 32 | * @param out 33 | * {@link WatchableStream} 34 | */ 35 | void streamClosed(WatchableStream out); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/PacketReceivedTimeHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | /** 24 | * Holds the time the last packet was received. 25 | */ 26 | public interface PacketReceivedTimeHolder { 27 | 28 | default long getLastPacketReceivedTime() { 29 | return 0; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/ProtocolEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | public interface ProtocolEntity { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/ResultsetRow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | import com.mysql.cj.result.Row; 24 | 25 | /** 26 | * Classes that implement this interface represent one row of data from the MySQL server that might be stored in different ways depending on whether the result 27 | * set was streaming (so they wrap a reusable packet), or whether the result set was cached or via a server-side cursor (so they represent a byte[][]). 28 | * 29 | * Notice that no bounds checking is expected for implementors of this interface, it happens in ResultSetImpl. 30 | */ 31 | public interface ResultsetRow extends Row, ProtocolEntity { 32 | 33 | default boolean isBinaryEncoded() { 34 | return false; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/ServerCapabilities.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | import com.mysql.cj.ServerVersion; 24 | 25 | /** 26 | * Represents server capabilities, retrieved right after creating physical connection and before handshake. 27 | */ 28 | public interface ServerCapabilities { 29 | 30 | int getCapabilityFlags(); 31 | 32 | void setCapabilityFlags(int capabilityFlags); 33 | 34 | ServerVersion getServerVersion(); 35 | 36 | long getThreadId(); 37 | 38 | void setThreadId(long threadId); 39 | 40 | boolean serverSupportsFracSecs(); 41 | 42 | int getServerDefaultCollationIndex(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/ValueEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | import com.mysql.cj.BindValue; 24 | import com.mysql.cj.conf.PropertySet; 25 | import com.mysql.cj.exceptions.ExceptionInterceptor; 26 | 27 | public interface ValueEncoder { 28 | 29 | void init(PropertySet pset, ServerSession serverSession, ExceptionInterceptor exceptionInterceptor); 30 | 31 | byte[] getBytes(BindValue binding); 32 | 33 | String getString(BindValue binding); 34 | 35 | long getTextLength(BindValue binding); 36 | 37 | long getBinaryLength(BindValue binding); 38 | 39 | void encodeAsText(Message msg, BindValue binding); 40 | 41 | void encodeAsBinary(Message msg, BindValue binding); 42 | 43 | void encodeAsQueryAttribute(Message msg, BindValue binding); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/Warning.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | public interface Warning { 24 | 25 | /** 26 | * Get warning level. 27 | * 28 | * @return Warning level 29 | */ 30 | int getLevel(); 31 | 32 | /** 33 | * Get warning code. 34 | * 35 | * @return Warning code 36 | */ 37 | long getCode(); 38 | 39 | /** 40 | * Get warning message. 41 | * 42 | * @return Warning message 43 | */ 44 | String getMessage(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/protocol/WatchableStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | public interface WatchableStream { 24 | 25 | void setWatcher(OutputStreamWatcher watcher); 26 | 27 | int size(); 28 | 29 | byte toByteArray()[]; 30 | 31 | void write(byte b[], int off, int len); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/telemetry/NoopTelemetryHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.telemetry; 22 | 23 | /** 24 | * No-op implementation of {@link TelemetryHandler}. 25 | */ 26 | public class NoopTelemetryHandler implements TelemetryHandler { 27 | 28 | private static NoopTelemetryHandler INSTANCE = new NoopTelemetryHandler(); 29 | 30 | public static NoopTelemetryHandler getInstance() { 31 | return INSTANCE; 32 | } 33 | 34 | private NoopTelemetryHandler() { 35 | } 36 | 37 | @Override 38 | public TelemetrySpan startSpan(TelemetrySpanName spanName, Object... args) { 39 | return NoopTelemetrySpan.getInstance(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/telemetry/NoopTelemetryScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.telemetry; 22 | 23 | /** 24 | * No-op implementation of {@link TelemetryScope}. 25 | */ 26 | public class NoopTelemetryScope implements TelemetryScope { 27 | 28 | private static NoopTelemetryScope INSTANCE = new NoopTelemetryScope(); 29 | 30 | public static NoopTelemetryScope getInstance() { 31 | return INSTANCE; 32 | } 33 | 34 | private NoopTelemetryScope() { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/telemetry/NoopTelemetrySpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.telemetry; 22 | 23 | /** 24 | * No-op implementation of {@link TelemetrySpan}. 25 | */ 26 | public class NoopTelemetrySpan implements TelemetrySpan { 27 | 28 | private static NoopTelemetrySpan INSTANCE = new NoopTelemetrySpan(); 29 | 30 | public static NoopTelemetrySpan getInstance() { 31 | return INSTANCE; 32 | } 33 | 34 | @Override 35 | public TelemetryScope makeCurrent() { 36 | return NoopTelemetryScope.getInstance(); 37 | } 38 | 39 | private NoopTelemetrySpan() { 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/telemetry/TelemetryScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.telemetry; 22 | 23 | /** 24 | * A telemetry context scope wrapper that hides all specific details from the underlying telemetry library. 25 | * 26 | * A default no-op implementation is provided so that telemetry may be turned off with minimal impact to the driver code. 27 | */ 28 | public interface TelemetryScope extends AutoCloseable { 29 | 30 | /** 31 | * {@link AutoCloseable#close()} that must be used to end this context scope and, thus, make it possible to create new span within try-with-resources 32 | * blocks. 33 | */ 34 | @Override 35 | default void close() { 36 | // Noop. 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/util/DataTypeUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.util; 22 | 23 | /** 24 | * Utilities to manipulate internal data type formats. 25 | */ 26 | public class DataTypeUtil { 27 | 28 | /** 29 | * Interpret a BIT value as a long. 30 | * 31 | * @param bytes 32 | * byte buffer 33 | * @param offset 34 | * offset in buffer 35 | * @param length 36 | * number of bytes to use 37 | * @return long value 38 | */ 39 | public static long bitToLong(byte[] bytes, int offset, int length) { 40 | long valueAsLong = 0; 41 | for (int i = 0; i < length; i++) { 42 | valueAsLong = valueAsLong << 8 | bytes[offset + i] & 0xff; 43 | } 44 | return valueAsLong; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/util/LRUCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.util; 22 | 23 | import java.util.LinkedHashMap; 24 | import java.util.Map.Entry; 25 | 26 | public class LRUCache extends LinkedHashMap { 27 | 28 | private static final long serialVersionUID = 1L; 29 | protected int maxElements; 30 | 31 | public LRUCache(int maxSize) { 32 | super(maxSize, 0.75F, true); 33 | this.maxElements = maxSize; 34 | } 35 | 36 | @Override 37 | protected boolean removeEldestEntry(Entry eldest) { 38 | return size() > this.maxElements; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/core-api/java/com/mysql/cj/util/TestUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.util; 22 | 23 | public class TestUtils { 24 | 25 | public static void dumpTestcaseQuery(String query) { 26 | System.err.println(query); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/SimpleQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj; 22 | 23 | //TODO should not be protocol-specific 24 | 25 | public class SimpleQuery extends AbstractQuery { 26 | 27 | public SimpleQuery(NativeSession sess) { 28 | super(sess); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/conf/BooleanProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.conf; 22 | 23 | public class BooleanProperty extends AbstractRuntimeProperty { 24 | 25 | private static final long serialVersionUID = 1102859411443650569L; 26 | 27 | protected BooleanProperty(PropertyDefinition propertyDefinition) { 28 | super(propertyDefinition); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/conf/EnumProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.conf; 22 | 23 | public class EnumProperty> extends AbstractRuntimeProperty { 24 | 25 | private static final long serialVersionUID = -60853080911910124L; 26 | 27 | protected EnumProperty(PropertyDefinition propertyDefinition) { 28 | super(propertyDefinition); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/conf/StringProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.conf; 22 | 23 | public class StringProperty extends AbstractRuntimeProperty { 24 | 25 | private static final long serialVersionUID = -4141084145739428803L; 26 | 27 | protected StringProperty(PropertyDefinition propertyDefinition) { 28 | super(propertyDefinition); 29 | } 30 | 31 | @Override 32 | public String getStringValue() { 33 | return this.value; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/otel/OpenTelemetryScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.otel; 22 | 23 | import com.mysql.cj.telemetry.TelemetryScope; 24 | 25 | import io.opentelemetry.context.Scope; 26 | 27 | public class OpenTelemetryScope implements TelemetryScope { 28 | 29 | private Scope scope = null; 30 | 31 | public OpenTelemetryScope(Scope scope) { 32 | this.scope = scope; 33 | } 34 | 35 | @Override 36 | public void close() { 37 | this.scope.close(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/core-impl/java/com/mysql/cj/protocol/WriterWatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol; 22 | 23 | /** 24 | * Objects that want to be notified of lifecycle events on a WatchableWriter should implement this interface, and register themselves with setWatcher() on the 25 | * WatchableWriter instance. 26 | */ 27 | public interface WriterWatcher { 28 | 29 | /** 30 | * Called when the Writer being watched has .close() called 31 | * 32 | * @param out 33 | * WatchableWriter instance 34 | */ 35 | void writerClosed(WatchableWriter out); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/doc/connector-j-overview.html: -------------------------------------------------------------------------------- 1 | 2 |

MySQL Connector/J Reference

3 | 4 |

This is a full documentation of Connector/J.

5 | 6 |

To get started with X DevAPI, check out some of the main classes:

7 | 8 |
    9 |
  • Sessions can be created with {@link com.mysql.cj.xdevapi.SessionFactory}.
  • 10 |
  • Session operations are available on a {@link com.mysql.cj.xdevapi.Session}.
  • 11 |
  • JSON document collections are represented by a {@link com.mysql.cj.xdevapi.Collection}.
  • 12 |
  • Working with JSON documents is done with a {@link com.mysql.cj.xdevapi.DbDoc}.
  • 13 |
14 | 15 |

For an introduction to concepts, refer to the X DevAPI User 16 | Guide.

17 | 18 | -------------------------------------------------------------------------------- /src/main/doc/mysqlx-overview.html: -------------------------------------------------------------------------------- 1 | 2 |

MySQL Connector/J X DevAPI Reference

3 | 4 |

This documentation covers the public classes and interfaces of the Java implementation of the X DevAPI. To get started, check out some of the main 5 | classes:

6 | 7 |
    8 |
  • Sessions can be created with {@link com.mysql.cj.xdevapi.SessionFactory}.
  • 9 |
  • Session operations are available on a {@link com.mysql.cj.xdevapi.Session}.
  • 10 |
  • JSON document collections are represented by a {@link com.mysql.cj.xdevapi.Collection}.
  • 11 |
  • Working with JSON documents is done with a {@link com.mysql.cj.xdevapi.DbDoc}.
  • 12 |
13 | 14 |

For an introduction to concepts, refer to the X DevAPI User 15 | Guide.

16 | 17 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/a/ClobValueEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.a; 22 | 23 | import java.sql.Clob; 24 | 25 | import com.mysql.cj.BindValue; 26 | import com.mysql.cj.exceptions.ExceptionFactory; 27 | 28 | public class ClobValueEncoder extends ReaderValueEncoder { 29 | 30 | @Override 31 | public byte[] getBytes(BindValue binding) { 32 | try { 33 | return readBytes(((Clob) binding.getValue()).getCharacterStream(), binding); 34 | } catch (Throwable t) { 35 | throw ExceptionFactory.createException(t.getMessage(), t, this.exceptionInterceptor); 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/CompressionMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | /** 24 | * The modes by which compression can be made. In message mode each X Protocol message is compressed independently of the others; in stream mode all messages 25 | * are compressed as if they belong to a continuous flow of compressed data. 26 | */ 27 | public enum CompressionMode { 28 | MESSAGE, STREAM; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/ContinuousOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import java.io.FilterOutputStream; 24 | import java.io.IOException; 25 | import java.io.OutputStream; 26 | 27 | /** 28 | * An {@link OutputStream} wrapper that can't be closed and flushes data instead when {@link #close()} is called. 29 | */ 30 | public class ContinuousOutputStream extends FilterOutputStream { 31 | 32 | protected ContinuousOutputStream(OutputStream out) { 33 | super(out); 34 | } 35 | 36 | /** 37 | * Instead of closing the {@link OutputStream} flushes its data. 38 | */ 39 | @Override 40 | public void close() throws IOException { 41 | flush(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntity; 24 | import com.mysql.cj.x.protobuf.MysqlxResultset.FetchDone; 25 | 26 | /** 27 | * ProtocolEntity representing a {@link FetchDone} message. 28 | */ 29 | public class FetchDoneEntity implements ProtocolEntity { 30 | 31 | public FetchDoneEntity() { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneEntityFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntityFactory; 24 | 25 | /** 26 | * Factory producing {@link FetchDoneEntity} from protocol message. 27 | */ 28 | public class FetchDoneEntityFactory implements ProtocolEntityFactory { 29 | 30 | @Override 31 | public FetchDoneEntity createFromMessage(XMessage message) { 32 | return new FetchDoneEntity(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneMoreResults.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntity; 24 | 25 | /** 26 | * ProtocolEntity representing a {@link FetchDoneMoreResults} message. 27 | */ 28 | public class FetchDoneMoreResults implements ProtocolEntity { 29 | 30 | public FetchDoneMoreResults() { 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/FetchDoneMoreResultsFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntityFactory; 24 | 25 | /** 26 | * Factory producing {@link FetchDoneMoreResults} from protocol message. 27 | */ 28 | public class FetchDoneMoreResultsFactory implements ProtocolEntityFactory { 29 | 30 | @Override 31 | public FetchDoneMoreResults createFromMessage(XMessage message) { 32 | return new FetchDoneMoreResults(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/NoticeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntityFactory; 24 | 25 | /** 26 | * Factory producing {@link Notice} from protocol message. 27 | */ 28 | public class NoticeFactory implements ProtocolEntityFactory { 29 | 30 | @Override 31 | public Notice createFromMessage(XMessage message) { 32 | return Notice.getInstance(message); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/Ok.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.QueryResult; 24 | import com.mysql.cj.protocol.ProtocolEntity; 25 | 26 | /** 27 | * ProtocolEntity representing an OK message. 28 | */ 29 | public class Ok implements ProtocolEntity, QueryResult { 30 | 31 | public Ok() { 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/OkFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntityFactory; 24 | 25 | /** 26 | * Factory producing {@link Ok} from protocol message. 27 | */ 28 | public class OkFactory implements ProtocolEntityFactory { 29 | 30 | @Override 31 | public Ok createFromMessage(XMessage message) { 32 | return new Ok(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/StatementExecuteOkFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntityFactory; 24 | 25 | /** 26 | * Factory producing {@link StatementExecuteOk} from protocol message. 27 | */ 28 | public class StatementExecuteOkFactory implements ProtocolEntityFactory { 29 | 30 | @Override 31 | public StatementExecuteOk createFromMessage(XMessage message) { 32 | return new StatementExecuteOk(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/SyncFlushDeflaterOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import java.io.OutputStream; 24 | import java.util.zip.Deflater; 25 | import java.util.zip.DeflaterOutputStream; 26 | 27 | /** 28 | * Wrapper around {@link DeflaterOutputStream} that enables sync flush by default. 29 | */ 30 | public class SyncFlushDeflaterOutputStream extends DeflaterOutputStream { 31 | 32 | public SyncFlushDeflaterOutputStream(OutputStream out) { 33 | super(out, new Deflater(), true); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/protocol-impl/java/com/mysql/cj/protocol/x/XProtocolRowFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.protocol.x; 22 | 23 | import com.mysql.cj.protocol.ProtocolEntityFactory; 24 | import com.mysql.cj.x.protobuf.MysqlxResultset.Row; 25 | 26 | /** 27 | * Factory producing an {@link XProtocolRow} from protocol message. 28 | */ 29 | public class XProtocolRowFactory implements ProtocolEntityFactory { 30 | 31 | @Override 32 | public XProtocolRow createFromMessage(XMessage message) { 33 | return new XProtocolRow(Row.class.cast(message.getMessage())); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/3-0-Compat.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Settings to maintain Connector/J 3.0.x compatibility 3 | # (as much as it can be) 4 | # 5 | 6 | emptyStringsConvertToZero=true 7 | jdbcCompliantTruncation=false 8 | noDatetimeStringSync=true 9 | nullCatalogMeansCurrent=true 10 | transformedBitIsBoolean=false 11 | dontTrackOpenResources=true 12 | zeroDateTimeBehavior=CONVERT_TO_NULL 13 | useServerPrepStmts=false 14 | autoClosePStmtStreams=true 15 | processEscapeCodesForPrepStmts=false 16 | populateInsertRowWithDefaultValues=false -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/clusterBase.properties: -------------------------------------------------------------------------------- 1 | # Basic properties for clusters 2 | autoReconnect=true 3 | failOverReadOnly=false 4 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/coldFusion.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Properties for optimal usage in ColdFusion 3 | # 4 | 5 | # 6 | # CF's pool tends to be "chatty" like DBCP 7 | # 8 | 9 | alwaysSendSetIsolation=false 10 | useLocalSessionState=true 11 | 12 | # 13 | # CF's pool seems to loose connectivity on page restart 14 | # 15 | 16 | autoReconnect=true 17 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/fullDebug.properties: -------------------------------------------------------------------------------- 1 | # Settings for 'max-debug' style situations 2 | profileSQL=true 3 | gatherPerfMetrics=true 4 | useUsageAdvisor=true 5 | logSlowQueries=true 6 | explainSlowQueries=true -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/maxPerformance-8-0.properties: -------------------------------------------------------------------------------- 1 | # 2 | # A configuration that maximizes performance, while 3 | # still staying JDBC-compliant and not doing anything that 4 | # would be "dangerous" to run-of-the-mill J2EE applications 5 | # 6 | # Note that because we're caching things like callable statements 7 | # and the server configuration, this bundle isn't appropriate 8 | # for use with servers that get config'd dynamically without 9 | # restarting the application using this configuration bundle. 10 | 11 | cachePrepStmts=true 12 | cacheCallableStmts=true 13 | 14 | cacheServerConfiguration=true 15 | 16 | # 17 | # Reduces amount of calls to database to set 18 | # session state. "Safe" as long as application uses 19 | # Connection methods to set current database, autocommit 20 | # and transaction isolation 21 | # 22 | 23 | useLocalSessionState=true 24 | elideSetAutoCommits=true 25 | alwaysSendSetIsolation=false 26 | 27 | # Can cause high-GC pressure if timeouts are used on every 28 | # query 29 | enableQueryTimeouts=false 30 | 31 | # Bypass connection attribute handling during connection 32 | # setup 33 | connectionAttributes=none 34 | 35 | # INFORMATION_SCHEMA in MySQL 8.0 is more efficient because 36 | # of integration with data dictionary 37 | useInformationSchema=true 38 | 39 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/maxPerformance.properties: -------------------------------------------------------------------------------- 1 | # 2 | # A configuration that maximizes performance, while 3 | # still staying JDBC-compliant and not doing anything that 4 | # would be "dangerous" to run-of-the-mill J2EE applications 5 | # 6 | # Note that because we're caching things like callable statements 7 | # and the server configuration, this bundle isn't appropriate 8 | # for use with servers that get config'd dynamically without 9 | # restarting the application using this configuration bundle. 10 | 11 | cachePrepStmts=true 12 | cacheCallableStmts=true 13 | 14 | cacheServerConfiguration=true 15 | 16 | # 17 | # Reduces amount of calls to database to set 18 | # session state. "Safe" as long as application uses 19 | # Connection methods to set current database, autocommit 20 | # and transaction isolation 21 | # 22 | 23 | useLocalSessionState=true 24 | elideSetAutoCommits=true 25 | alwaysSendSetIsolation=false 26 | 27 | # Can cause high-GC pressure if timeouts are used on every 28 | # query 29 | enableQueryTimeouts=false 30 | 31 | # Bypass connection attribute handling during connection 32 | # setup 33 | connectionAttributes=none 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/com/mysql/cj/configurations/solarisMaxPerformance.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Solaris has pretty high syscall overhead, so these configs 3 | # remove as many syscalls as possible. 4 | # 5 | 6 | # Reduce recv() syscalls 7 | 8 | useUnbufferedInput=false 9 | useReadAheadInput=false 10 | 11 | # Reduce number of calls to getTimeOfDay() 12 | 13 | maintainTimeStats=false -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/CloseOption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc; 22 | 23 | import java.util.Arrays; 24 | 25 | public enum CloseOption { 26 | 27 | IMPLICIT, // Close operation initiated internally by a clean up routine. 28 | FORCED, // A forced, hard close. 29 | ROLLBACK, // Allow rollback during the close operation. 30 | PROPAGATE, // Allow propagating the close operation to dependents and owner objects. 31 | NO_CACHE; // Does not allow caching the closing object. 32 | 33 | public boolean in(CloseOption... options) { 34 | return Arrays.stream(options).anyMatch(this::equals); 35 | } 36 | 37 | public boolean notIn(CloseOption... options) { 38 | return Arrays.stream(options).noneMatch(this::equals); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/JdbcPropertySet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc; 22 | 23 | import java.sql.DriverPropertyInfo; 24 | import java.sql.SQLException; 25 | import java.util.List; 26 | 27 | import com.mysql.cj.conf.PropertySet; 28 | 29 | public interface JdbcPropertySet extends PropertySet { 30 | 31 | /** 32 | * Exposes all ConnectionPropertyInfo instances as DriverPropertyInfo 33 | * 34 | * @return a {@link List} of all ConnectionPropertyInfo instances, as DriverPropertyInfo 35 | * 36 | * @throws SQLException 37 | * if an error occurs 38 | */ 39 | List exposeAsDriverPropertyInfo() throws SQLException; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/ha/LoadBalancedConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc.ha; 22 | 23 | import java.sql.SQLException; 24 | 25 | import com.mysql.cj.jdbc.JdbcConnection; 26 | 27 | public interface LoadBalancedConnection extends JdbcConnection { 28 | 29 | boolean addHost(String host) throws SQLException; 30 | 31 | void removeHost(String host) throws SQLException; 32 | 33 | void removeHostWhenNotInUse(String host) throws SQLException; 34 | 35 | void ping(boolean allConnections) throws SQLException; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/jdbc/result/CachedResultSetMetaData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc.result; 22 | 23 | import java.sql.ResultSetMetaData; 24 | 25 | import com.mysql.cj.protocol.ColumnDefinition; 26 | 27 | public interface CachedResultSetMetaData extends ColumnDefinition { 28 | 29 | ResultSetMetaData getMetadata(); 30 | 31 | void setMetadata(java.sql.ResultSetMetaData metadata); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/AddResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * A result from the collection.add() statement. 27 | */ 28 | public interface AddResult extends Result { 29 | 30 | /** 31 | * Get a list of document ids generated in the server for the documents added by collection.add(). 32 | * 33 | * @return all generated document ids 34 | */ 35 | List getGeneratedIds(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/DocResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * A sequence of documents retrieved from a find query. 25 | */ 26 | public interface DocResult extends FetchResult, Result { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/InsertResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * A result from the table.insert() statement. 25 | */ 26 | public interface InsertResult extends Result { 27 | 28 | /** 29 | * Get the auto-increment value if one was generated from a row insert statement. 30 | * 31 | * @return auto-increment value 32 | */ 33 | Long getAutoIncrementValue(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/JsonValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * Common interface for classes representing standard JSON object, array, number, string and 'true', 'false' and 'null' literals 25 | * and non-standard extensions like mysqlx.expr() expressions. 26 | */ 27 | public interface JsonValue { 28 | 29 | /** 30 | * Get a human readable "pretty" JSON string. 31 | * 32 | * @return human readable "pretty" JSON string 33 | */ 34 | default String toFormattedString() { 35 | return toString(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/RowResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | import java.util.List; 24 | 25 | /** 26 | * A result exposing a set of rows from a SELECT query. 27 | */ 28 | public interface RowResult extends FetchResult, Result { 29 | 30 | /** 31 | * Count of columns. 32 | * 33 | * @return count 34 | */ 35 | int getColumnCount(); 36 | 37 | /** 38 | * Metadata. 39 | * 40 | * @return list of result {@link Column} objects 41 | */ 42 | List getColumns(); 43 | 44 | /** 45 | * Names of columns. 46 | * 47 | * @return list of result column names 48 | */ 49 | List getColumnNames(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/SqlResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * A result from a SQL statement which may have several sets of data following by a DML result. 25 | */ 26 | public interface SqlResult extends Result, InsertResult, RowResult { 27 | 28 | /** 29 | * Move to the next result. This method has no effect after returning false for the first time. 30 | * 31 | * @return was there a next result that we moved to? 32 | */ 33 | default boolean nextResult() { 34 | return false; 35 | } 36 | 37 | @Override 38 | default Long getAutoIncrementValue() { 39 | throw new XDevAPIError("Method getAutoIncrementValue() is allowed only for insert statements."); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/SqlStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * A statement representing a raw SQL command. 25 | */ 26 | public interface SqlStatement extends Statement { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * Column type. 25 | */ 26 | public enum Type { 27 | BIT, TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, FLOAT, DECIMAL, DOUBLE, JSON, STRING, BYTES, TIME, DATE, DATETIME, TIMESTAMP, SET, ENUM, GEOMETRY, 28 | } 29 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/UpdateType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * Update operation type. 25 | */ 26 | public enum UpdateType { 27 | // these must mirror exactly the names of UpdateOperation.UpdateType in mysqlx_crud.proto 28 | SET, ITEM_REMOVE, ITEM_SET, ITEM_REPLACE, ITEM_MERGE, ARRAY_INSERT, ARRAY_APPEND, MERGE_PATCH 29 | } 30 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/Warning.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * A warning generated during statement execution. 25 | */ 26 | public interface Warning extends com.mysql.cj.protocol.Warning { 27 | } 28 | -------------------------------------------------------------------------------- /src/main/user-api/java/com/mysql/cj/xdevapi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * Java classes for X DevAPI support. 23 | * 24 | * @since 6.0 25 | */ 26 | 27 | package com.mysql.cj.xdevapi; 28 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/EscapeProcessorResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc; 22 | 23 | /** 24 | * Wraps output from EscapeProcessor, to help prevent multiple passes over the query string, to detect characters such as '@' (defining/using a variable), 25 | * which are used further up the call stack to handle failover. 26 | */ 27 | class EscapeProcessorResult { 28 | 29 | boolean callingStoredFunction = false; 30 | 31 | String escapedSql; 32 | 33 | byte usesVariables = StatementImpl.USES_VARIABLES_FALSE; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/NClob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc; 22 | 23 | import com.mysql.cj.exceptions.ExceptionInterceptor; 24 | 25 | /** 26 | * Simplistic implementation of java.sql.NClob for MySQL Connector/J 27 | */ 28 | public class NClob extends Clob implements java.sql.NClob { 29 | 30 | NClob(ExceptionInterceptor exceptionInterceptor) { 31 | super(exceptionInterceptor); 32 | } 33 | 34 | public NClob(String charDataInit, ExceptionInterceptor exceptionInterceptor) { 35 | super(charDataInit, exceptionInterceptor); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/exceptions/OperationNotSupportedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc.exceptions; 22 | 23 | import java.sql.SQLException; 24 | 25 | import com.mysql.cj.Messages; 26 | import com.mysql.cj.exceptions.MysqlErrorNumbers; 27 | 28 | public class OperationNotSupportedException extends SQLException { 29 | 30 | static final long serialVersionUID = 474918612056813430L; 31 | 32 | public OperationNotSupportedException() { 33 | super(Messages.getString("RowDataDynamic.3"), MysqlErrorNumbers.SQLSTATE_CONNJ_ILLEGAL_ARGUMENT); 34 | } 35 | 36 | public OperationNotSupportedException(String message) { 37 | super(message, MysqlErrorNumbers.SQLSTATE_CONNJ_ILLEGAL_ARGUMENT); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/ha/NdbLoadBalanceExceptionChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc.ha; 22 | 23 | public class NdbLoadBalanceExceptionChecker extends StandardLoadBalanceExceptionChecker { 24 | 25 | @Override 26 | public boolean shouldExceptionTriggerFailover(Throwable ex) { 27 | return super.shouldExceptionTriggerFailover(ex) || checkNdbException(ex); 28 | } 29 | 30 | private boolean checkNdbException(Throwable ex) { 31 | // Have to parse the message since most NDB errors are mapped to the same DEMC, sadly. 32 | return ex.getMessage().startsWith("Lock wait timeout exceeded") 33 | || ex.getMessage().startsWith("Got temporary error") && ex.getMessage().endsWith("from NDB"); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/jdbc/result/CachedResultSetMetaDataImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.jdbc.result; 22 | 23 | import com.mysql.cj.result.DefaultColumnDefinition; 24 | 25 | public class CachedResultSetMetaDataImpl extends DefaultColumnDefinition implements CachedResultSetMetaData { 26 | 27 | /** Cached ResultSetMetaData */ 28 | java.sql.ResultSetMetaData metadata; 29 | 30 | @Override 31 | public java.sql.ResultSetMetaData getMetadata() { 32 | return this.metadata; 33 | } 34 | 35 | @Override 36 | public void setMetadata(java.sql.ResultSetMetaData metadata) { 37 | this.metadata = metadata; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/AddResultBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * Result builder producing an {@link AddResult} instance. 25 | */ 26 | public class AddResultBuilder extends UpdateResultBuilder { 27 | 28 | @Override 29 | public AddResult build() { 30 | return new AddResultImpl(this.statementExecuteOkBuilder.build()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/AddResultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | import java.util.List; 24 | 25 | import com.mysql.cj.protocol.x.StatementExecuteOk; 26 | 27 | /** 28 | * A result from the collection.add() statement. 29 | */ 30 | public class AddResultImpl extends UpdateResult implements AddResult { 31 | 32 | /** 33 | * Constructor. 34 | * 35 | * @param ok 36 | * the response from the server 37 | */ 38 | public AddResultImpl(StatementExecuteOk ok) { 39 | super(ok); 40 | } 41 | 42 | @Override 43 | public List getGeneratedIds() { 44 | return this.ok.getGeneratedIds(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/InsertResultBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * Result builder producing an {@link InsertResult} instance. 25 | */ 26 | public class InsertResultBuilder extends UpdateResultBuilder { 27 | 28 | @Override 29 | public InsertResult build() { 30 | return new InsertResultImpl(this.statementExecuteOkBuilder.build()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/InsertResultImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | import com.mysql.cj.protocol.x.StatementExecuteOk; 24 | 25 | /** 26 | * A result from a statement that doesn't return a set of rows. 27 | */ 28 | public class InsertResultImpl extends UpdateResult implements InsertResult { 29 | 30 | /** 31 | * Create a new result. 32 | * 33 | * @param ok 34 | * the response from the server 35 | */ 36 | public InsertResultImpl(StatementExecuteOk ok) { 37 | super(ok); 38 | } 39 | 40 | @Override 41 | public Long getAutoIncrementValue() { 42 | return this.ok.getLastInsertId(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/user-impl/java/com/mysql/cj/xdevapi/JsonLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.xdevapi; 22 | 23 | /** 24 | * Represents JSON true, false and null literals. 25 | */ 26 | public enum JsonLiteral implements JsonValue { 27 | 28 | TRUE("\u0074\u0072\u0075\u0065"), FALSE("\u0066\u0061\u006c\u0073\u0065"), NULL("\u006E\u0075\u006C\u006C"); 29 | 30 | public final String value; 31 | 32 | private JsonLiteral(String val) { 33 | this.value = val; 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return this.value; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-cert-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEGzCCAwOgAwIBAgIUFkSKT1xCWg2PSu8fZs6OlZps+WIwDQYJKoZIhvcNAQEL 3 | BQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRcwFQYDVQQH 4 | DA5SZWR3b29kIFNob3JlczEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNR 5 | TDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVjdG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEW 6 | EG15c3FsQG9yYWNsZS5jb20wHhcNMjAwNjAzMjMyNTMwWhcNMzAwNjAxMjMyNTMw 7 | WjCBnDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcM 8 | DlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQKDAZPcmFjbGUxDjAMBgNVBAsMBU15U1FM 9 | MR0wGwYDVQQDDBRNeVNRTCBDb25uZWN0b3IvSiBDQTEfMB0GCSqGSIb3DQEJARYQ 10 | bXlzcWxAb3JhY2xlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB 11 | AMkV8+jk2aOxHxnNOu86Ejlqd28i6BcfXtjXz9c7sEDrKJStrOzSHI94wka7HEYe 12 | r3lcMf5rBO3/hNGcL6YLzkpZVKfttR/lvqsihxatLgZ0mFHp2onXd7yPkK3Ana6q 13 | xmHCQ1ASAq4sFXCmNN7Zo6u5Y48pg1ZEMCyGlz3Stu9jov4/YrXY8r3bvnda+B9S 14 | FNJenl8ynSxy6ynnpgk9y9wKFbM2wj2BjGbpirvgr+wmPsmbgExzUrED2YsJpkof 15 | nxlWBuxPnpx7cJ6zGdDQLagbfZ5ortHRSFMcYVMIpGJr9eGjf7u4sE9/UVx4gp/f 16 | p6jQKlOG2FxjQLyvjstu7BsCAwEAAaNTMFEwHQYDVR0OBBYEFC6X3Chl98Mi25O5 17 | xl08SCvAaeL/MB8GA1UdIwQYMBaAFC6X3Chl98Mi25O5xl08SCvAaeL/MA8GA1Ud 18 | EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIs+qEZxZUcjdYSIbXMxbppf 19 | r522fQ1yAzVgb/k2SaRR8gRTMW2/u6iazIrTRCuy2UyCY0cSw/I6j+H7rKEikhLl 20 | Nu2whzIQKUCoO1b8EKYrtX0djmxTTo/G/AgjygmlxEWMI1v2GpiaD+rOXXMvfFGC 21 | sNfQ2Bbi1mw8V/ZHShb53Bdpzs5H5NNF75Lz0SIiLxmi6fXoHXXmUHtE5dkfRmko 22 | a4/V8WcyMDOJQK/TSnsG3ug3Mg6Lkdu8uwXZcyEJ3eX40xjLyrNpq+evVHI4jM/W 23 | 93ak/JebSNWMyMY9USETkDT0nWxvcKm5stMH6WKW+7cf4TQdGNKWwbzE4GMwQnw= 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEDTCCAvWgAwIBAgIJAIiYHFajCcAZMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYD 3 | VQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEXMBUGA1UEBwwOUmVkd29vZCBT 4 | aG9yZXMxDzANBgNVBAoMBk9yYWNsZTEOMAwGA1UECwwFTXlTUUwxHTAbBgNVBAMM 5 | FE15U1FMIENvbm5lY3Rvci9KIENBMR8wHQYJKoZIhvcNAQkBFhBteXNxbEBvcmFj 6 | bGUuY29tMB4XDTE3MDMwNDAwMDM0M1oXDTI3MDMwMjAwMDM0M1owgZwxCzAJBgNV 7 | BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNo 8 | b3JlczEPMA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwU 9 | TXlTUUwgQ29ubmVjdG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNs 10 | ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDLkHXpKMO4oUI0 11 | S64R4D2MIFtS9xXX4BK7jDW/VefKh87k9kLBPqKPb7NKqdCFcJk/JBrfvgQwb63U 12 | FH2TX3NYSQ/4gXG/UZoUMG9EK8KZ7gpKvrbgBSYAyOhE+dLrE7HYCesmS3Y4Owib 13 | 0QJx8IozDQm/JencKk7swfT6sSBvPb/rvAegiOoxb7S2EW0zWlIw4P9kPmu8X4IW 14 | 6u79gW1HyOAIi0wKFbqgXwTHaz+VtqjRglYi0U48H2xqw5IpVhZg9Di1VzeZESkD 15 | RVPNoFhhlX0xYfl3/+ZoNRVJDQHE6qXSfkDLePzw81Bl+OwO2CYZ0EXwW0bzgk9u 16 | HXuvuKrpAgMBAAGjUDBOMB0GA1UdDgQWBBSaoJ8RI8gbLGSrUwrrCbqvZR3i6DAf 17 | BgNVHSMEGDAWgBSaoJ8RI8gbLGSrUwrrCbqvZR3i6DAMBgNVHRMEBTADAQH/MA0G 18 | CSqGSIb3DQEBCwUAA4IBAQCHl2ezisRplspyEyqEH4uvBbBr1zGDXKn6BtPufXws 19 | 4S+itxrw16sGI3RmYheyYuZPM+9PlwFMsWRJtfxZc4svZRr/s9IoHHQiV/KBILfu 20 | 5JDxY1UwZcGHZ0b8XlgeBOxnq15z7YaU7+pPAVmpxmnehJCK8s+y5TlM2S2OEvYP 21 | I2swAXDE5Gzwq1Y/VExQZhRQL5LXGiNjZV+VHeLO3Vf5HrKUsKSTnq5kvdIwWELz 22 | o3NqS88gr36lBzh3aqX3/rxS0QdR4iecoG+ztO5ZS5mFpgqP+2aNAano/8cQ7jIQ 23 | 8cm4akxWarBQRLik2lB+kwsxiyGF+k8NjVUAIUh70U7H 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-key-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpgIBAAKCAQEAyRXz6OTZo7EfGc067zoSOWp3byLoFx9e2NfP1zuwQOsolK2s 3 | 7NIcj3jCRrscRh6veVwx/msE7f+E0ZwvpgvOSllUp+21H+W+qyKHFq0uBnSYUena 4 | idd3vI+QrcCdrqrGYcJDUBICriwVcKY03tmjq7ljjymDVkQwLIaXPdK272Oi/j9i 5 | tdjyvdu+d1r4H1IU0l6eXzKdLHLrKeemCT3L3AoVszbCPYGMZumKu+Cv7CY+yZuA 6 | THNSsQPZiwmmSh+fGVYG7E+enHtwnrMZ0NAtqBt9nmiu0dFIUxxhUwikYmv14aN/ 7 | u7iwT39RXHiCn9+nqNAqU4bYXGNAvK+Oy27sGwIDAQABAoIBAQCeQ832JnB5WoWM 8 | 7C+Pa9g+ImKgMQwUbtdaufjWgR8G6U7GPi9VMUXTUgsuWkQ1mB8p2Htsr9RwcWSb 9 | CV+jQ7V4ZPixNvEQiuVXklRab7FC2W+tQO6FAPY3jZMkfe5dNAHxnVEXayV66i1x 10 | vQ7tusQL+1y1p8m8Eu0Ljl7pBLiAjjgNJKDCalgo9EeYlWB4DOKLsiF24E5GKUqB 11 | X3zXAKvi5zzYMejhkZFLQE2dekshRP88O35+bw3ozw238HAKyoMAYeVf2jVwktUW 12 | 30jHW4yru5Af2W2030EWoh4nUDfZUk7jvw8zquhltMm/Ca/qSvKjq6kOTXu+7U6U 13 | sIJHBqxhAoGBAPNHE1uKUzu0KV1yVXkc3jTYnknoCCE6iu/0dC6L9PcR4td7wTmq 14 | WAqfUUv8dfwR2mAmyvULIWwaiWv7IcPnt4amXe+biukE4vzOoa74i9cgxXu5A8od 15 | zUwBq07mk01UABQy63LJHB9kDeo6XeTNZjM7a3vFJgDKc3pc78JvGnkxAoGBANOa 16 | BoXIWYu5RKIFhyBRLNDSCdZPKi5AMh3Er2oi5QJztf87sFm2EK6vuCnLc+Qhcj8f 17 | MgZiXwlJCOKgRKyGKGaIl/zIwKxEhHKsN8slHQuVvhp+9qz/CFQYcyM9ye4GdHTq 18 | pfNVrIMZdu83aIRcmi04F+obsu+ZZVZoQCDk2WcLAoGBAKqIRDWC/V14qRZsMyY2 19 | 6jy5LBw6nphMZWBXR6npScp3qz/J7GTz18t6ao6NZldQXHfSOasUJlWVNIeQ/tZI 20 | 9AlbTbXMns9BMaxtXEE+0Sf4PPbBdrqTsXl6Ig+o6dDm9TczioBoIWKPzIFIcNEW 21 | enGnUWztgfpD8DbyNs9g+nnBAoGBAKDOo/hVit+pe2QaCVfg+Mr1ZC5u2SJu/Ocs 22 | ixaA0EMtxnjiVqHGwCTRO4bfrAIJ/PXFclHxvkGjNFJt8+KczeUmF0MvGWWRaIpx 23 | ILGMUed09BTUugg8hIrMTevRUD1IwIX9sQIc8M5ssrsXA6Hbcfu9bkcmp7R4gc/J 24 | yDp3UFSDAoGBAKPlusGAGwoM+Rk1fUiNHLF3uzi69OoeKFqeq9mUmGpkXs7fB1HJ 25 | b1/XaTQSMMt35JFlHbiQIG/iINNHL92IO1X2jUswB1P0gyPhv/KTcQ4VRXU+l846 26 | rq26BAfo/dxUd761PNj0XyIjYhddgbkbeF1lxnLqNZJ80rW0JXPa76qz 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAy5B16SjDuKFCNEuuEeA9jCBbUvcV1+ASu4w1v1XnyofO5PZC 3 | wT6ij2+zSqnQhXCZPyQa374EMG+t1BR9k19zWEkP+IFxv1GaFDBvRCvCme4KSr62 4 | 4AUmAMjoRPnS6xOx2AnrJkt2ODsIm9ECcfCKMw0JvyXp3CpO7MH0+rEgbz2/67wH 5 | oIjqMW+0thFtM1pSMOD/ZD5rvF+CFuru/YFtR8jgCItMChW6oF8Ex2s/lbao0YJW 6 | ItFOPB9sasOSKVYWYPQ4tVc3mREpA0VTzaBYYZV9MWH5d//maDUVSQ0BxOql0n5A 7 | y3j88PNQZfjsDtgmGdBF8FtG84JPbh17r7iq6QIDAQABAoIBAQCAQDGphl9ZUW/u 8 | lsfCx26/fBtNeBKxAaGLu9iZBbyVo168blK8gYPVruBc6ARSLhC+8TZlRMhK4/G2 9 | rno3gWmgc9e2D4fkq7rRgXp4jsF6Tbj6QpHhLh01XV7JJkS2ip//prAaXmzLHJZd 10 | 5R8PPicz5sD/RxnB9n3nOIPp9fKjYjlikzESEn+BaimTFGTX2X2w/exrzDpT6jd5 11 | hTBg/v4UAs/+5v/M6646VPctz+Mc9Db1b2EH35Nv3kXHX2ts3ChRzjgKEDbEBT/q 12 | d6yb+3zd8sdZJqxWQtWMAN6BGwzSJZ3//zaqyY8K7YNEHwHJWAjjlRG1PcgQRgZc 13 | zcKVfKOpAoGBAPlu+strrwUBJD9AA1FgUQBMmCtvS1L5e4VQSqyR1g62ok3VBnJ/ 14 | olUREbMVoSJK0Kjuz+Hzrs4t6md8i1AC4zwOly/JKqWsuPXb6sCNNEi6SB6zrg4p 15 | 9CmUIp99QdpZV5Gqkk2kK/nyMHuwIbuZRLBoEpzAFmPghU+ajalKcemzAoGBANDs 16 | WiSZ6iRa9AHY69kC2V8eoRueZJTl1Kb7MsRo3vJ4GNHA5g/qbkSzDndPwpgfalvV 17 | nOZLYOCBw/HpNxAjjLMgELaVi6LsG9yA7BiXjpcUFykFsc1KdHhTOFoIS+E9mspq 18 | Otj26gwuPNJkzePJjPLAbD8KszCvoDFr8iI1EdLzAoGBAPcS5GAdcYdegx4X9XFl 19 | G7dVJ6JWouE0+RKr3twjtUprxEeejL1cCluDBepDsZH7U8cSj16899mJh9gseP6v 20 | bZEuzrlp5dGoTqpSxa0n8bNculWXHAExs4aAEu+yrklwGBrVQAiiZ2E1cqsCY9ek 21 | 0XKAFHeqmkMiwkqAyHP5pu6bAoGAYe85PkkMEei00xzdScflH4qbGPhBy+6EpZXB 22 | MYK7Z8vWTpTvA2zwLbIFyPYRkP/A+rWCrA2Ppw4NTRv2nNEdRmZ0jzJA16l4Uf/5 23 | LHn29GkNhkROGZ6aREE2fDXBZB9drR7o4QW1puoRxspMHUhAkxaSZ2bboqnhHOmu 24 | Ak0AQvMCgYAEBbYfB6PmIvPL458OL3DSc+CGyp+SMep9d5WJrSjjersO55nn3/LL 25 | lxV+zdN6gR7jQn0xtn7rHp/IpPFBc7FUqcTPFnc9YrIrBaS5yvhmv94yOf+4MCq0 26 | 7FYG2XRl9QRl+FSsxHFl8m/sl38GdIl7CQvafc2BXozdwTrzSjTSuA== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mysql/mysql-connector-j/20ef8ee9eb4294a03858acccea0ddad3525f1ff9/src/test/config/ssl-test-certs/ca-truststore -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/ca-truststore-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mysql/mysql-connector-j/20ef8ee9eb4294a03858acccea0ddad3525f1ff9/src/test/config/ssl-test-certs/ca-truststore-ext -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-cert-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDsjCCApoCAQEwDQYJKoZIhvcNAQELBQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYD 3 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNob3JlczEPMA0GA1UE 4 | CgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVj 5 | dG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wHhcNMjAw 6 | NjAzMjMzMDE5WhcNMzAwNjAxMjMzMDE5WjCBoDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQK 8 | DAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMSEwHwYDVQQDDBhNeVNRTCBDb25uZWN0 9 | b3IvSiBDbGllbnQxHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wggEi 10 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDcO3YhUeTcyj8F3R6OqRrcLLKx 11 | h3FW6bGZL5jSO+GkMLoSWasN8wlaUGz7TJ3bmYmr1XZ8aBWVKlZVzN3vdIaOMd0/ 12 | ceoG1oiyLNHfsqo3bdA0RNMzEDj1sts8i8Ucs+sa5mI+vS7RY7gqYeybLRGYRGWu 13 | 5CTIVbTsI5BS3RS3Ekb4WcdFTFfZvEvLWSNn7ssyDdCpE6vywIwwmymk8+5L7tye 14 | xGhHQYx3Dl65yZMdgXl0b78TrJia7TIospTHRLS2cZewQCdT4Wb694JHqp1esJWP 15 | ay/xe2IACQ7H8Uco1yU1yIx1mF6YaAoyk5LKkTD9sCZgxmSoD6EhpcnhwgSbAgMB 16 | AAEwDQYJKoZIhvcNAQELBQADggEBABZNcp/PAWOQPHMjSErsqTVUpI6O2VYX8EYZ 17 | lLFb5cy7oDaTlH4vo1Fn/jCDZ7bcWuGIYVzu0xurXtowSq5xvcaxtVVzPWZobTth 18 | USrInathbupk6h2zkOjMzwS6nd86+VwI6rr6RflR5nS/T85+r19/68OtHLIcJTkP 19 | x8A03X1PzoIZh57cKcRLNabtOstk7ErnC9rXJaO8dbq9WDWkrWpQGekz4pJB2oh0 20 | CZADcrIedPRaLJ8X3ghm6ucmmCCrhKUrYYPev2O9oq9lk9Pv8ryhTWnxWjB1Ckye 21 | /Puyla0a/YDYZffWBJsunUuw7P9rnnMtKyi3/SsBOpGsxhtmSYk= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDsjCCApoCAQEwDQYJKoZIhvcNAQELBQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYD 3 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNob3JlczEPMA0GA1UE 4 | CgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVj 5 | dG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wHhcNMTcw 6 | MzA0MDAwNzA3WhcNMjcwMzAyMDAwNzA3WjCBoDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQK 8 | DAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMSEwHwYDVQQDDBhNeVNRTCBDb25uZWN0 9 | b3IvSiBDbGllbnQxHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wggEi 10 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCluIoIzfZDPJYrHet8kbyeG+rp 11 | 8GLVDcZ0n0EOHqkviSSpi2iEkxolpWXVBN6DddP0jE9Pitpf8dyfEnRUeEYQrU21 12 | da788gaA17mZZsfP36QRW3Jz2tekodlYtKSeo4Gl+IPIyBjeQG9sqSpQe9oyruJV 13 | LUmz9euPtJj1UqhTBVDAW9NgCGgfqAEw0Hos+H8+/LRia/9O8VThVTzlPaiJylli 14 | xxin4/JkFiQj+R7CDyhNfnY/9kY0XoeVemjkOWCMAstSqjQzevRtVdXeduzsL6fq 15 | g4tKgqOXaWUT9g2XC1807qExmo4o13X9v9fXCNv4R+vwzofYp0DSmbHUrBPhAgMB 16 | AAEwDQYJKoZIhvcNAQELBQADggEBAJg0npMHVfOXDDGbqQzRaqNY51id6/0tagRa 17 | FQfVNjaLDWI5WDDw+LRGxgiBEthbWP/dPWjiZrEr0LQFIvDcAqEtZNNcoAQEMr28 18 | tuOmVad0Es/lMf1xxghBkn8XjVwUUmLpW+WEfI1NvSdrsn70e04A0LXj88zxa2eJ 19 | smUU2ML7dAfvb+EYhLB5jnlO/ARQ8eMwHiN/lsEntX8iEDwhID+7gFubgmIkxyjM 20 | LsqgqayvTvQ/WvWSCk73oVqSRhlN30N/ses7TUDWyUvZTJorrekIiMCwNFJ6gPCU 21 | OlWO3mCFgt47XlCzLMfqfOKxDxGkcxW+S4nU0m7FbRPf7rMmBxk= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-key-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpQIBAAKCAQEA3Dt2IVHk3Mo/Bd0ejqka3CyysYdxVumxmS+Y0jvhpDC6Elmr 3 | DfMJWlBs+0yd25mJq9V2fGgVlSpWVczd73SGjjHdP3HqBtaIsizR37KqN23QNETT 4 | MxA49bLbPIvFHLPrGuZiPr0u0WO4KmHsmy0RmERlruQkyFW07COQUt0UtxJG+FnH 5 | RUxX2bxLy1kjZ+7LMg3QqROr8sCMMJsppPPuS+7cnsRoR0GMdw5eucmTHYF5dG+/ 6 | E6yYmu0yKLKUx0S0tnGXsEAnU+Fm+veCR6qdXrCVj2sv8XtiAAkOx/FHKNclNciM 7 | dZhemGgKMpOSypEw/bAmYMZkqA+hIaXJ4cIEmwIDAQABAoIBAQDUZHQUxkoVtOb6 8 | 3LlvlB7XYDQlih4AV/hzZ7fWaPG/y05oDBovpcfLVe0EnmtPMc/X7FIMwMSvytjg 9 | fmc7XAG4eNaLLW0pkxTZ4Oe2+TO3qSw2fHnCsU59hjRxO8qpV8rRcoYlQ4Y3Yhhm 10 | p3HsZZamZrA57sSagC2v3sx9XcFwm2HaGE5iKQSst883GV/IZWPdfT9WohbwxZe5 11 | TuMDvA9bj7u1WXxzw1xcs4pv1u3UqZMY29tEmnkiz2125Ju8ADMYjgsJS1TDcwn4 12 | xHrKVItQrXmfOh8EvXneo0ROlBwSVIHNA7CPoZJKtmOjZ1VOwV2Q//OzhO6wysFx 13 | xJhMIC9hAoGBAPAWNY9Cnx2YlJbhATChixpNBtQXiiufPE3sG+U9ZGxC06b5yoeW 14 | V5q0d9ejy/B5y1UhlqQEIoYm47Rf0n4gJxymWnoq3C279x6mXxBR+KwATufDcxvm 15 | HTRyAFqjNOZSlknM5v4n6hmAQWhLIv/vRLzNulZ4maCQ6pp72AJN/KAVAoGBAOrU 16 | XIiFnqJ866XihA2pi8XAIcfRH0tFWrNYFyOJifRa3N59/YxTI+mxBqVFldNToT4w 17 | BOG0nAQsrvCk2dtBb2pOhrqpgqLW29uBdrclHp2qr/zXT6eQUMCl2HngGsYR/Ge5 18 | itbKrtREEgfioc6huU97OeuhPfquuFZTFj2WCY3vAoGBALytt4nOoZ1wu9WXHohJ 19 | bDhPMH6dwUhm682RMJsHlFRAcHVY+YF09YPvL/+YCj4CeXl93BUp6rfi+DBY3eOh 20 | ARvS4GgCJucKQTslJLB+ux7xXxFk2KGkRm9g6EZS3M/lN5boIOC8HY3M7Zo48liQ 21 | gUSfqUErphA50yV1Dl1BTLfBAoGBAKZE9LvJeFfugV90MjIGQSwkbQaxICpIkf74 22 | OXH1GZPFnit/I75uw7fcmyr8SShXR4zjrSEuo2UlSjyjTIm9HCk2LpkOGqw323Xh 23 | hfAJPVM/nto0jXbEbRjqlIs+zVY/N+staYvJ+N3c0LN6mTzYL4CCbLFU+rB7c5PT 24 | wqSajmtLAoGAJ84BpcZUYul9A7uDfQluVqQsp1fRS92FP4Yq7qVVccz9es2NosN9 25 | b8ZVpRdqxEvx8RvKPjXrl9VBqW7YuUvRrH7DRw+vmixeqnsLmCq6fGUeP75rTFPH 26 | EcUdNhwYMjpZWxNxOLcA34QLYZopkNVp/loQ8Dy5wntWfPZzKVwVHNI= 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEApbiKCM32QzyWKx3rfJG8nhvq6fBi1Q3GdJ9BDh6pL4kkqYto 3 | hJMaJaVl1QTeg3XT9IxPT4raX/HcnxJ0VHhGEK1NtXWu/PIGgNe5mWbHz9+kEVty 4 | c9rXpKHZWLSknqOBpfiDyMgY3kBvbKkqUHvaMq7iVS1Js/Xrj7SY9VKoUwVQwFvT 5 | YAhoH6gBMNB6LPh/Pvy0Ymv/TvFU4VU85T2oicpZYscYp+PyZBYkI/kewg8oTX52 6 | P/ZGNF6HlXpo5DlgjALLUqo0M3r0bVXV3nbs7C+n6oOLSoKjl2llE/YNlwtfNO6h 7 | MZqOKNd1/b/X1wjb+Efr8M6H2KdA0pmx1KwT4QIDAQABAoIBADV0tXHpngpKPNZj 8 | rFZeXE1UDA6yL+8xplZwGHgJg+GFh4H5Khm5qbGDDLoN/AjDtT8pE1xBGffg+J2H 9 | QmcM9OzkOjDSaUPGfjqJW6ET+lgfd7jxmpWsferpGkb23jMd4vA6nafig8MNXePb 10 | HX8gtF2s8+0t0pxuMzIDu2NG6mz8wQ3/V4vrbOM/AV5oXysfWei1NyU8z0DDHBd6 11 | GrriUvKUPmSXWR1uO6LKMO0+TxCZlAFHN0K7Ej1LU5nw3nzGaHkggvmch7od1qXr 12 | 7C6Hlf1I2iX2x7l14P99rQrj0JLZtm0aB3HHAymfNk0yrzkEraaUgkTccSfknfaq 13 | iD4ZBwECgYEA0SMQXt4ZyOVGYFPxegQF8BW/7S/FRdoQS94t5NJ04uZgWo0VMYII 14 | Pl05r3QLn4+86ZB5Pzg6lsC0d/GpsHxPoHXl9+LTlXkGWoorLGbMA1L+P7ZrUwP0 15 | tx/tDioc6mwautExV/VcIJm5j1c6PbpsEBCRBDCu9meVcKl18UAl2qkCgYEAytrz 16 | 6Dy5qxyXui3jcBvKPtk6ETs5uxWekQvMNB6jmN6qKlKle1yaJwIwWwV671iUjPst 17 | UN+AJGELdgZJOzg9AHeoIpvgGQ2bMp5NwTimvY6M6kbH4za+bgZAXZdYoqB5ReZG 18 | 5QR1+eEL+r9oVvqcCaAYc3r30uDxMPNRZR6oKnkCgYEAkvyO6+4ztyOVU+yLolMj 19 | jTrsGprhjpeVrozoOpPD/RknjVztEU+v1Y0WFv97j9ipUIru/ITbgMrNzCM4PUcR 20 | e9iBGbj9NmfKFGZZs6pIJun0sfjW85CrNO2mYbctfYEfRD/06zoSVwNUDK+kym+0 21 | tZG/Km/A+IOS34zqzPVl5YkCgYEAiDLOBKWQ+6Qs8yIQTJs8BUqQRDWBo2z2k+hZ 22 | 6LyRlvgZRGVNGjCoh3xevx5E1iKhSq7yVBRb0xEdQtchoBM4UfIE/4esxOVvyGKl 23 | ThAdU7Q8RKfVWWbOIM0ttikBp98azaW4/9co5ucExgxxn8SPs568C/0KG5pQFk+n 24 | 3L7ipfECgYBAoVUMbq8WbT9GQr2lIs4P3/tDX7PZ3YgoN2+txoVi16Xzxcy1YUBE 25 | gd9prvNpOULwlXd7/Ip3riXkypU7tKXmsu8WloucOO+cHSpGXKzt0I8bbHYYx46N 26 | 2GZb7oVya/0nv9vWuPF94eKAd//qA/FyCgQexDG/F7fT44uf5Vw0Vw== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mysql/mysql-connector-j/20ef8ee9eb4294a03858acccea0ddad3525f1ff9/src/test/config/ssl-test-certs/client-keystore -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/client-keystore-ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mysql/mysql-connector-j/20ef8ee9eb4294a03858acccea0ddad3525f1ff9/src/test/config/ssl-test-certs/client-keystore-ext -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/mykey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQDBzoqQuwZ9/eKMOU0OXWJ4ISj+2YEk8l4OmBoC9Y2wNEe4Pcjz 3 | mCF/f9aZDyH6znh0G6gmb/yrTvuNLYkTUgiFNm0yJ2rSzlgmJZHkWykRkjKr4V04 4 | iAaHdU4ORre7Ms9eln7k8CeVQFpCjM51HOLkp8IhnAVrkOhSbHI4vxprbQIDAQAB 5 | AoGBAJbMD3L3ouCLmCfFOhiwPrr8CjrpoBvQXbD7VlnxGDL/KsLHiEFJoN7k6GQl 6 | qynMV1r4XgiyYCYnCYHa6WpYDPnHI59pq4P7UUkO8hC54FVSbnZvNLnveRa4hmYv 7 | d/7uRGEygJ0ifrHaaAztLHx5MgpMveJ4FTeQK0bjnOvTk0FBAkEA4v2QFc6em3bF 8 | 5CIvtmo44dpeX/89dzShGLheIAMlgrq2a7ZYi5L7G4NQH+nUKErObtqjGnhtZNjp 9 | 6El2B+LVfQJBANqTTz9bAIVJhnLpJz39YNXgtHQFuSNeqwI1b3XW5X037+2G1Fu5 10 | vEqc4rSn+auzqnPhvWaHL6e9s+BgxRUxELECQQCFLGLGiIzBhTOhHvWDPlrVFzrb 11 | c3JqZ7REPpbqjS4KvuSb2UWlzbwJbkcqEhPo98qZeyjKNPFpg2HoaIEZK1o5AkA6 12 | fDA4Q6FgCMxw8vINJD9E+1tNsDpZvHsFnEa2wUmmt9D7PZiU8p3vWQtQS6ICz5BM 13 | cZq8VG/r8lavMzWI9hgBAkBz92TmpDXjqsa9pJ2reqjc9EwvBwH0d4Up8jKrUotc 14 | qFNXFtt+UCBRM358LYNHJlEmorc/EM9Tx89YeNGwSgXU 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/mykey.pub: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBzoqQuwZ9/eKMOU0OXWJ4ISj+ 3 | 2YEk8l4OmBoC9Y2wNEe4PcjzmCF/f9aZDyH6znh0G6gmb/yrTvuNLYkTUgiFNm0y 4 | J2rSzlgmJZHkWykRkjKr4V04iAaHdU4ORre7Ms9eln7k8CeVQFpCjM51HOLkp8Ih 5 | nAVrkOhSbHI4vxprbQIDAQAB 6 | -----END PUBLIC KEY----- 7 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-cert-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDsjCCApoCAQEwDQYJKoZIhvcNAQELBQAwgZwxCzAJBgNVBAYTAlVTMRMwEQYD 3 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA5SZWR3b29kIFNob3JlczEPMA0GA1UE 4 | CgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDEdMBsGA1UEAwwUTXlTUUwgQ29ubmVj 5 | dG9yL0ogQ0ExHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wHhcNMjAw 6 | NjAzMjMyNzUxWhcNMzAwNjAxMjMyNzUxWjCBoDELMAkGA1UEBhMCVVMxEzARBgNV 7 | BAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8wDQYDVQQK 8 | DAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMSEwHwYDVQQDDBhNeVNRTCBDb25uZWN0 9 | b3IvSiBTZXJ2ZXIxHzAdBgkqhkiG9w0BCQEWEG15c3FsQG9yYWNsZS5jb20wggEi 10 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCTHer68cds/M3Q7Z5VTn3cgDc2 11 | XKUZV4u7nXQF/lT/W7HPtpP+cJpRRbWXpwbO4whjY6vaXYvwSh9vrrfOYp7eqg9W 12 | yGQjVV3GoCJdIp+JJVG9wdYbWcWlFDNdHPOrtbkDRq9DjDlqDA9P7CM5BwykSoG1 13 | YakxjeMJWYiHLWCTJRhzE4YZ7+H/2yDwwpcgES9JwEjrEnevjR9ygCJlC05ofkwL 14 | CG6PDYdOagxcY70fW5q6U2fpBfS1WqkUZtxs5cPf7F+kdRUXPfLi2c6eAjTZVJEl 15 | JCajrGH6+f/d4pP/4ial0+nBhpZbxwccjHnhFb3YZLJprz0g3q9cBU1xMkuvAgMB 16 | AAEwDQYJKoZIhvcNAQELBQADggEBAEcoIY6hiQ9Pw3axZIY1k70Hj2EFrjtrCZNz 17 | IaOTuosQvZXAhyLU1YViU//KdR6JwI4orLZJWrSQkoAJrp38nlaiQIjqOCz2kEkE 18 | 70Cs1KWSJ9PSmQG5+JfpK+q7rFLu62MwsswRdWxXImnXrp0+pAKjGffBtuM0r51s 19 | z2nyZEpJM82h4JoFbfYm7G/7LGSiZYFEYMuVuR1N/IkAkLa6pYJuzP8CQX9BV0sb 20 | hhVCyG2xaRRk7l3OrGGUGLpGaGZAUoQtsmTrL0v533qCl0FpKAe8oL3TGP5qGgJY 21 | 1nZOplN4foXOvjKEBm+cf0gI2vQ7FzSROZ0GsY3WCLZwnwLGZkU= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEUjCCAzqgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBnDELMAkGA1UEBhMCVVMx 3 | EzARBgNVBAgMCkNhbGlmb3JuaWExFzAVBgNVBAcMDlJlZHdvb2QgU2hvcmVzMQ8w 4 | DQYDVQQKDAZPcmFjbGUxDjAMBgNVBAsMBU15U1FMMR0wGwYDVQQDDBRNeVNRTCBD 5 | b25uZWN0b3IvSiBDQTEfMB0GCSqGSIb3DQEJARYQbXlzcWxAb3JhY2xlLmNvbTAe 6 | Fw0yMDA3MDgxMDUxNTNaFw0zMDA3MDYxMDUxNTNaMIGgMQswCQYDVQQGEwJVUzET 7 | MBEGA1UECAwKQ2FsaWZvcm5pYTEXMBUGA1UEBwwOUmVkd29vayBTaG9yZXMxDzAN 8 | BgNVBAoMBk9yYWNsZTEOMAwGA1UECwwFTXlTUUwxITAfBgNVBAMMGE15U1FMIENv 9 | bm5lY3Rvci9KIFNlcnZlcjEfMB0GCSqGSIb3DQEJARYQbXlzcWxAb3JhY2xlLmNv 10 | bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJw8ZFOmkBrUmAwPtmWS 11 | tdfWR6GTw1mfzWEDKwz3wHiyqkZ2tBLxVSs+bou7d9ig+v+t7d2zsc2I4IArK5rv 12 | sbheZ/qhjxrFekGAgfJHuY2J9sdhP208Lv3DSf+9GYyCMbccSNbFEWNkE4TvwHs/ 13 | cekr0+UjH1eJ476WLjiuDTZwUlR5X/uVPKWDr2lGzMt+CCIOTygMqj6pi11Cr0Pj 14 | +IUK96NwBg+tOknD8Z7bl979Fl8WNPl6SGhhQ6FLtfZCz7U5FKEybYrRYgVfd5DG 15 | ke6y76VOaN9YFpS7VvSB5b+OkZ1WtNgo7Iao5PqT7Nks5T9gr2jNZVJjWz1+hIvp 16 | EM8CAwEAAaOBmDCBlTCBkgYDVR0RBIGKMIGHghdidWc5OTc2Ny5teXNxbC5zYW4x 17 | LnRzdIIQKi5teXNxbC5zYW4yLnRzdIITYnVnKi5teXNxbC5zYW4zLnRzdIIVKjk5 18 | NzY3Lm15c3FsLnNhbjQudHN0ghNidWc5OTc2Ny4qLnNhbjUudHN0ggpidWc5OTc2 19 | Ny4qggEqhwQJCQdDhwRjBwYHMA0GCSqGSIb3DQEBCwUAA4IBAQAHjmQ6bUvc2gLp 20 | 0OnGTTx22yfTK5xfClKQod5qCow20TZZJKmRa8vbXzPnXYi2eyn+NFqXtzI1BSc1 21 | 3DN+A3l/yyfvm3nnbRVqTdHTNNKWFuXdrdSaKY3pVUbTT+ZV4rx/dDBI94lQQ7lV 22 | SvEITgzda3JmloICZiIFuKgZ3pnJwGh7yakqKTZOC9w2G7zQjwC129L8gczimd9C 23 | 0NB7Ux5Lxz8KG5ggk6EgXtSjrw5kz9bLKbrBxqeTbt6hIijzdg/DN9ARswFxmEW5 24 | gRE9efLrjyuO7ceZ9Qdw7PEsbClf5Hq5FeOrlNeew3AnKMUPFRddVJF+cOemhZvE 25 | 6ancGoGh 26 | -----END CERTIFICATE----- 27 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-key-ext.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAkx3q+vHHbPzN0O2eVU593IA3NlylGVeLu510Bf5U/1uxz7aT 3 | /nCaUUW1l6cGzuMIY2Or2l2L8Eofb663zmKe3qoPVshkI1VdxqAiXSKfiSVRvcHW 4 | G1nFpRQzXRzzq7W5A0avQ4w5agwPT+wjOQcMpEqBtWGpMY3jCVmIhy1gkyUYcxOG 5 | Ge/h/9sg8MKXIBEvScBI6xJ3r40fcoAiZQtOaH5MCwhujw2HTmoMXGO9H1uaulNn 6 | 6QX0tVqpFGbcbOXD3+xfpHUVFz3y4tnOngI02VSRJSQmo6xh+vn/3eKT/+ImpdPp 7 | wYaWW8cHHIx54RW92GSyaa89IN6vXAVNcTJLrwIDAQABAoIBAHoBH7RI+ogKB22z 8 | AdHhLEPHGQK+RjUEA1/uLiAiUb8L/iQyV/10yKWJ2BUScXT1lylFqWmIltsJvZRT 9 | Ix/HbdVe1yWzPkiHLSPh/V2brw5/opBpxfQcuOo0HHyl2/aU2AA9iG/ORHcL1U8E 10 | mBldHUDKgVM40KXF83j3hWAFY8fig8dsq8cCEGHZjSVFk4NqCk2kYvgq/yZD+CZe 11 | K+drgTSvTymLY1RRz3VPQlPVP1aJjimjUIXIQHsVH+eYq0mt3fpDDiq2hpjctJr/ 12 | kct9gASxtzkIwX1h6UJY6OI6Uc9PUEQDn+s1YYp3Me8imsG2QHFchQV4z0oUy/kc 13 | g0PI7fECgYEAwobACHdRbmDzP9ePJn7giMT9YwS8UuMuJUfXjNeuH7rDxjMnRlYB 14 | 2O4NdVNbgheiE15tQRdSRse1ND3D8+oLIy9I0ruMQwqqnMZqAD1lOnrMRC0jblpy 15 | nUX+OVF7YILHHUEa0hv5wGJwW/0hEqqN/rduxL8kl8f9yMeQhdqpXsMCgYEAwZu5 16 | DlzaH5wbtK1he7jk2Hxrxmxq5AbnfJJsSGQ1fbvilEV290tmkgjVSUFPz5TzlWFf 17 | 8CgcnL06KZzqK2nRieHuWyIlCgJiy6HbfL6TaL9Y7P1t1/T0EEuT3M21kceKXodr 18 | QHFOyhYMbJkLSX/feAZ023wb7vkXXCNG5BfDaKUCgYAkTc+zBMmuxus+4/T0Y0N2 19 | YwVDIJQhCAMJtCG3SF1X0JxO9icDSnPnz221kswGOHDoGnxbZIXXbdgUmt5iPDC9 20 | 7UozAguIS4pR3fnUd6DXzCkpJB9zre+sCG8MtXdIKMAOZqMhyVTQIc8Ea/ZrLGd5 21 | vTQwBdhHd2yWtx/yyz9GzwKBgQC4xzqzLoMvL/pxUhh70Fb5FqZ11fuebch45/ZY 22 | kOtMeQkiobmNA3V9YtjM9XyKjYp8w1ahCmdkYGUmWhBUJsZJZkvqxoe7KdPIrU2h 23 | nPFrQ1RHuwge2DYnZzpTvjDQVTUGSxBdjMa5sJli/B39pAFPuDnHUIgIZ8uXsEN0 24 | Zgml0QKBgGCkWamKqDlFlPbVN+wJRIuMwAB6mNLYqL+loRd4VnYMK7crEZdbdOTK 25 | gZFUwfhvDm+6bHbza8dqSImeOUkFAi9vetycb9sXvNVtmmXNyGIGezPkL4bApJ80 26 | cKK7k/MU71+t+e9/r3s+o4PGJ8joaTFZgqzId3nuQ7iy8PIPJRlv 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/config/ssl-test-certs/server-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAnDxkU6aQGtSYDA+2ZZK119ZHoZPDWZ/NYQMrDPfAeLKqRna0 3 | EvFVKz5ui7t32KD6/63t3bOxzYjggCsrmu+xuF5n+qGPGsV6QYCB8ke5jYn2x2E/ 4 | bTwu/cNJ/70ZjIIxtxxI1sURY2QThO/Aez9x6SvT5SMfV4njvpYuOK4NNnBSVHlf 5 | +5U8pYOvaUbMy34IIg5PKAyqPqmLXUKvQ+P4hQr3o3AGD606ScPxntuX3v0WXxY0 6 | +XpIaGFDoUu19kLPtTkUoTJtitFiBV93kMaR7rLvpU5o31gWlLtW9IHlv46RnVa0 7 | 2Cjshqjk+pPs2SzlP2CvaM1lUmNbPX6Ei+kQzwIDAQABAoIBAGGepn1SBJaPIVXf 8 | 93Kt4asz+1vtDNGSNOyZ4yteHkgMMrKGduujGTlE8COlBjQ4Gbzp+0dcgQtQrB3J 9 | W5yaiiwN6OBEVDtBCquk1Q0CXeEfRC++BriFM0Nh43nEuRL/QnsMVELFraCxpjSY 10 | 7WbU9KLhvKteb7XttXyfL9BAiIbrW5TrHQ9FPfADg6pmckHoQnNkE4S1CQq1z/4w 11 | erlyeTNFa/ExAsrPsmjMp/6bur4zdW4t+5GpB2DZf+4P4pEIHJGRwNzU/Eq0TlNs 12 | TTmhlba6X/gSMNm0vYEXnNItb+ItiOsGqoLCzUzaAN7jvdsqAiVaiRvObtBLj76/ 13 | 17INnOECgYEA0E2ZHzVg9MaMUhC9dwHawGbbqeZfnAC89J9Hapt0WDtMuulsA+V8 14 | C2Ek4Rxpe62DuXdcvYSSuL3VJ4oWffkKngll5m+SiCSuuaDT9KAJ01sklIsGDAWE 15 | E0gYWg1sqsj5UE2r7O5TzfRnitglDwyNY87KYvxX7jI6mpHCPSHbblECgYEAwAKy 16 | DaIS6gtOfXLhXfzV+Qslsulcf4FRdI06XFVhmXziW6spdl2qVuKTWAiKK69zTRQD 17 | 2cXVxMf+VEvF7btyllNBYEdU1NcX3gCqCmb1LRqngIQkL0oPlXVaZnN5q17tXAPO 18 | Oxd3waefIqBjWJ03qc37oQzuCAXBiYKlUFLVJR8CgYAmgNF29VTwqeqyGKoM32jh 19 | +6FK7Gxr168VwINg7084J+3s9syig77EE7bPbYMJ+27Hz4py9ZhxUZWe82Vo76nI 20 | wI/3YlRBmhY59cJ4C0UFrmk6k+AQRMy/C6qEqsqVXwTGlTTcXMlc3nptLbrb50QT 21 | WNwMI/zU6K/wdlTjG+kFoQKBgG79X+UHib1mOcHENUe6Dgm+itUnlcNSgj5IILMc 22 | 26T4jnQEtZvpOrysjhV2IkBsU877QdqRRCdSn84kWs43612/1GuN8Bh0GSTH54LJ 23 | zvF6ldZxC+WV/voa8t2D5JHN9pCY1o5L23rCpPdEFQk1H+b03X5T1ggnI5+UOHD8 24 | 4J5rAoGBAJ2x4bRSj/vBgiNUvyvTv6JQoH1hCvDNEYT4TUr8XzMjVcS5voqokAQc 25 | mGseepXn6OU+JDW7N/DvgNStkgN6Gj1J/aTwPerC7exkMr4c6YOudjZUZJnOjUj4 26 | qHfAGQ5Vwo7fc9S6ymaxzAw5bFNHhZd4P3D1qzpU4804r8CMExUM 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /src/test/java/com/mysql/cj/result/BinaryStreamValueFactoryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package com.mysql.cj.result; 22 | 23 | import static org.junit.jupiter.api.Assertions.assertEquals; 24 | 25 | import org.junit.jupiter.api.Test; 26 | 27 | import com.mysql.cj.conf.DefaultPropertySet; 28 | 29 | public class BinaryStreamValueFactoryTest extends CommonAsserts { 30 | 31 | @Test 32 | public void testBasics() { 33 | BinaryStreamValueFactory vf = new BinaryStreamValueFactory(new DefaultPropertySet()); 34 | assertEquals("java.io.InputStream", vf.getTargetTypeName()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/testsuite/regression/NonLocalSocketFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package testsuite.regression; 22 | 23 | import com.mysql.cj.Session; 24 | import com.mysql.cj.protocol.StandardSocketFactory; 25 | 26 | public class NonLocalSocketFactory extends StandardSocketFactory { 27 | 28 | @Override 29 | public boolean isLocallyConnected(Session sess) { 30 | String processHost = "www.oracle.com:3306"; 31 | return isLocallyConnected(sess, processHost); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/testsuite/simple/SimpleTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package testsuite.simple; 22 | 23 | import java.util.Properties; 24 | 25 | import com.mysql.cj.conf.ConnectionPropertiesTransform; 26 | import com.mysql.cj.conf.PropertyKey; 27 | 28 | /** 29 | * Used for testing the ConnectionPropertiesTransform functionality. 30 | */ 31 | public class SimpleTransformer implements ConnectionPropertiesTransform { 32 | 33 | @Override 34 | public Properties transformProperties(Properties props) { 35 | props.setProperty(PropertyKey.HOST.getKeyName(), "albequerque"); 36 | 37 | return props; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/testsuite/x/devapi/BaseTableTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | package testsuite.x.devapi; 22 | 23 | import static org.junit.jupiter.api.Assumptions.assumeTrue; 24 | 25 | import org.junit.jupiter.api.AfterEach; 26 | import org.junit.jupiter.api.BeforeEach; 27 | 28 | import com.mysql.cj.conf.PropertyDefinitions; 29 | 30 | /** 31 | * @todo 32 | */ 33 | public class BaseTableTestCase extends DevApiBaseTestCase { 34 | 35 | @BeforeEach 36 | public void setupBaseTableTest() { 37 | assumeTrue(this.isSetForXTests, PropertyDefinitions.SYSP_testsuite_url_mysqlx + " must be set to run this test."); 38 | super.setupTestSession(); 39 | } 40 | 41 | @AfterEach 42 | public void teardownBaseTableTest() { 43 | super.destroyTestSession(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/testsuite/x/devapi/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * Dev API test suite. 23 | */ 24 | 25 | package testsuite.x.devapi; 26 | -------------------------------------------------------------------------------- /src/test/java/testsuite/x/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015, 2025, Oracle and/or its affiliates. 3 | * 4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by 5 | * the Free Software Foundation. 6 | * 7 | * This program is designed to work with certain software that is licensed under separate terms, as designated in a particular file or component or in 8 | * included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the 9 | * separately licensed software that they have either included with the program or referenced in the documentation. 10 | * 11 | * Without limiting anything contained in the foregoing, this file, which is part of MySQL Connector/J, is also subject to the Universal FOSS Exception, 12 | * version 1.0, a copy of which can be found at http://oss.oracle.com/licenses/universal-foss-exception. 13 | * 14 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * Tests for internal components of the X Protocol and X DevAPI features. 23 | */ 24 | 25 | package testsuite.x.internal; 26 | --------------------------------------------------------------------------------