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 | WjCBnDELMAkGA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jLyrNpq+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 | u7iw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czeUmF0MvGWWRaIpx
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/ZGNF6HlXpo5DlgjALLUqo0M3r0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gZRGVNGjCoh3xevx5E1iKhSq7yVBRb0xEdQtchoBM4UfIE/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 | VQQIDApDYWxpZm9ybmlhMRcwFQYDVQQHDA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2nyZEpJM82h4JoFbfYm7G/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 | G1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XXbdgUmt5iPDC9
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+0dcgQt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zMjVcS5voqokAQc
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 |
--------------------------------------------------------------------------------