Both applications, Windows and Z/OS, are connecting to the same MySQL Server instance? If so, in what system is the server Running?
Have you tried a basic test using just Connector/J? Something like:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
public class Test {
public static void main(String[] args) throws Exception {
final String url = "jdbc:mysql://[USER]:[PASSWORD]@[HOST]:[PORT]/[DATABASE]?sslMode=disabled&allowPublicKeyRetrieval=true";
try (Connection conn = DriverManager.getConnection(url); ResultSet rs = conn.createStatement().executeQuery("SELECT CURRENT_USER()")) {
while (rs.next()) {
System.out.println(rs.getString(1));
}
}
}
}
Please try this and share your results.