Java gitlab管道中的Cassandra exception com.datastax.driver.core.exceptions.NoHostAvailableException

Java gitlab管道中的Cassandra exception com.datastax.driver.core.exceptions.NoHostAvailableException,java,cassandra,gitlab,Java,Cassandra,Gitlab,当我在gitlab管道中运行此代码时,它会失败,并出现NoHostAvailableException错误。它在我的家乡很好用。有人能建议我该怎么做才能让它在管道中运行吗? 一个猜测是可能禁用SSL?当我在gitlab管道中运行它时,我该怎么做 String serverIp = testConfig.get("serverIp"); String keyspace = testConfig.get("keyspace&qu

当我在gitlab管道中运行此代码时,它会失败,并出现NoHostAvailableException错误。它在我的家乡很好用。有人能建议我该怎么做才能让它在管道中运行吗? 一个猜测是可能禁用SSL?当我在gitlab管道中运行它时,我该怎么做

     String serverIp = testConfig.get("serverIp");  
              String keyspace = testConfig.get("keyspace");
              String username = testConfig.get("username"); 
              String password = testConfig.get("password");
              
              String query = select * from bills where accountnumber='1234567'order by sequencenumber;
              
         
              SocketOptions so = new SocketOptions();
              so.setConnectTimeoutMillis(connectionTimeOut);
              so.setReadTimeoutMillis(readTimeOut);
                      
                     Cluster cluster = Cluster.builder().addContactPoint(serverIp).withPort(port).withCredentials(username, password).withSocketOptions(so).build();
                        
                     Session session = cluster.connect(keyspace);

 for (Row row : session.execute(query)) {
              
              billsequencenumber = row.getInt("sequencenumber"); 
              accountnumber = row.getString("accountnumber"); 
                                      
              }

您是否尝试连接到数据库,并且能够获取值?是。我可以直接从cassandra完成,但不确定如何将其放入代码中,连接到cassandra数据库并运行查询。关于如何使用代码连接它,我是否可以遵循一些说明?尝试连接到数据库并获取值,稍后再担心
请放心
。看看这是否有助于获得以下结果。[行[144144141,414141,152,1,B,C,462020-10-042018-09-0533000-0110579227îu 2382020-08-04]]如何读取下面尝试但不工作的所有值set results=getSession()。执行(“从test.table中选择*)//getsession返回一个会话int numcols=results.getColumnDefinitions().size();for(Row-Row:results){for(int-colIndex=0;colIndex