Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci-4.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
module: 'vertx-mssql-client'
- os: ubuntu-latest
jdk: 8
profile: 'DB2-11.5'
module: 'vertx-db2-client'
- os: ubuntu-latest
jdk: 8
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-matrix-5.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
module: 'vertx-mssql-client'
- os: ubuntu-latest
jdk: 11
profile: 'DB2-11.5'
module: 'vertx-db2-client'
- os: ubuntu-latest
jdk: 11
Expand Down
8 changes: 1 addition & 7 deletions vertx-db2-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,10 @@
<!-- Testing purposes -->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-db2</artifactId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>11.1.4.4</version>
<scope>test</scope>
</dependency>
<!-- SLF4J API for test code and Testcontainers -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
/*
* Copyright (C) 2019,2020 IBM Corporation
* Copyright (c) 2011-2026 Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*/
package io.vertx.db2client.impl;

Expand All @@ -24,23 +19,18 @@
import io.vertx.core.spi.metrics.ClientMetrics;
import io.vertx.db2client.DB2ConnectOptions;
import io.vertx.db2client.DB2Exception;
import io.vertx.db2client.impl.codec.ConnectionState;
import io.vertx.db2client.impl.codec.DB2CommandMessage;
import io.vertx.db2client.impl.codec.DB2Codec;
import io.vertx.db2client.impl.codec.DB2PreparedStatement;
import io.vertx.db2client.impl.codec.ExtendedBatchQueryDB2CommandMessage;
import io.vertx.db2client.impl.codec.ExtendedQueryDB2CommandMessage;
import io.vertx.db2client.impl.codec.*;
import io.vertx.db2client.impl.command.InitialHandshakeCommand;
import io.vertx.db2client.impl.drda.ConnectionMetaData;
import io.vertx.db2client.impl.drda.SQLState;
import io.vertx.db2client.impl.drda.SqlCode;
import io.vertx.sqlclient.SqlConnectOptions;
import io.vertx.sqlclient.codec.CommandMessage;
import io.vertx.sqlclient.spi.connection.Connection;
import io.vertx.sqlclient.codec.SocketConnectionBase;
import io.vertx.sqlclient.internal.PreparedStatement;
import io.vertx.sqlclient.internal.QueryResultHandler;
import io.vertx.sqlclient.codec.SocketConnectionBase;
import io.vertx.sqlclient.spi.DatabaseMetadata;
import io.vertx.sqlclient.spi.connection.Connection;
import io.vertx.sqlclient.spi.protocol.CommandBase;
import io.vertx.sqlclient.spi.protocol.ExtendedQueryCommand;
import io.vertx.sqlclient.spi.protocol.SimpleQueryCommand;
Expand Down Expand Up @@ -141,7 +131,9 @@ protected <R> void doSchedule(CommandBase<R> cmd, Completable<R> handler) {
@Override
public void handleClose(Throwable t) {
super.handleClose(t);
context().runOnContext(closeHandler);
if (closeHandler != null) {
context().runOnContext(closeHandler);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
/*
* Copyright (C) 2020 IBM Corporation
* Copyright (c) 2011-2026 Contributors to the Eclipse Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*/
package io.vertx.tests.db2client;

Expand All @@ -32,8 +27,6 @@
import java.util.List;
import java.util.UUID;

import static org.junit.Assume.assumeTrue;

@RunWith(VertxUnitRunner.class)
public class DB2DataTypeTest extends DB2TestBase {

Expand Down Expand Up @@ -214,35 +207,6 @@ public void testUUID(TestContext ctx) {
}));
}

@Test
public void testRowId(TestContext ctx) {
assumeTrue("Only DB2/Z supports the ROWID column type", rule.isZOS());

final String msg = "insert data for testRowId";
connect(ctx.asyncAssertSuccess(conn -> {
// Insert some data
conn
.preparedQuery("INSERT INTO ROWTEST (message) VALUES ('" + msg + "')")
.execute()
.onComplete(ctx.asyncAssertSuccess(insertResult -> {
// Find it by msg
conn
.preparedQuery("SELECT * FROM ROWTEST WHERE message = '" + msg + "'")
.execute()
.onComplete(ctx.asyncAssertSuccess(rows -> {
RowId rowId = verifyRowId(ctx, rows, msg);
// Now find it by rowid
conn
.preparedQuery("SELECT * FROM ROWTEST WHERE id = ?")
.execute(Tuple.of(rowId))
.onComplete(ctx.asyncAssertSuccess(rows2 -> {
verifyRowId(ctx, rows2, msg);
}));
}));
}));
}));
}

/**
* Test to support using enum string values in the Row and Tuple methods.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
package io.vertx.tests.db2client;

import static org.junit.Assume.assumeFalse;

import java.util.Arrays;
import java.util.function.Consumer;
/*
* Copyright (c) 2011-2026 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*/

import org.junit.Test;
import org.junit.runner.RunWith;
package io.vertx.tests.db2client;

import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.RowIterator;
import io.vertx.sqlclient.RowSet;
import io.vertx.sqlclient.Tuple;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.Arrays;
import java.util.function.Consumer;

/**
* Tests for subqueries which are documented here:
Expand Down Expand Up @@ -180,8 +188,6 @@ public void testSectionReuse(TestContext ctx) {
*/
@Test
public void testSequenceQuery(TestContext ctx) {
assumeFalse("TODO: Sequences behave differently on DB2/z and need to be implemented properly", rule.isZOS());

connect(ctx.asyncAssertSuccess(con -> {
con
.query("values nextval for my_seq")
Expand Down Expand Up @@ -214,8 +220,6 @@ public void testSequenceQuery(TestContext ctx) {
*/
@Test
public void testSequenceQueryPrepared(TestContext ctx) {
assumeFalse("TODO: Sequences behave differently on DB2/z and need to be implemented properly", rule.isZOS());

connect(ctx.asyncAssertSuccess(con -> {
con
.preparedQuery("VALUES nextval for my_seq")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
package io.vertx.tests.db2client;

import static org.junit.Assume.assumeFalse;

import java.util.Arrays;
/*
* Copyright (c) 2011-2026 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
*/

import org.junit.Test;
import org.junit.runner.RunWith;
package io.vertx.tests.db2client;

import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import io.vertx.sqlclient.Row;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.Arrays;

/**
* Tests for table joins which are documented here:
Expand Down Expand Up @@ -84,7 +92,6 @@ public void testRightOuterJoin(TestContext ctx) {

@Test
public void testFullOuterJoin(TestContext ctx) {
assumeFalse("DB2 on Z does not support operations within ON clause for FULL OUTER JOIN", rule.isZOS());
testJoin(ctx, "FULL OUTER JOIN");
}

Expand Down
Loading