public JdbcConnection prepareQuery(String preparedQueryString,Stream<String> parameters,SingleParameterResultSetConsumer resultConsumer) throws SQLException {
  Connection conn=connection();
  try (PreparedStatement statement=conn.prepareStatement(preparedQueryString)){
    for (Iterator<String> iter=parameters.iterator(); iter.hasNext(); ) {
      String value=iter.next();
      statement.setString(1,value);
      boolean success=false;
      try (ResultSet resultSet=statement.executeQuery()){
        if (resultConsumer != null) {
          success=resultConsumer.accept(value,resultSet);
          if (!success)           break;
        }
      }
     }
  }
   return this;
}

public JdbcConnection prepareQuery ( String preparedQueryString , Stream < String > parameters , SingleParameterResultSetConsumer resultConsumer ) throws SQLException { Connection conn = connection ( ) ; try ( PreparedStatement statement = conn . prepareStatement ( preparedQueryString ) ) { for ( Iterator < String > iter = parameters . iterator ( ) ; iter . hasNext ( ) ; ) { String value = iter . next ( ) ; statement . setString ( 1 , value ) ; boolean success = false ; try ( ResultSet resultSet = statement . executeQuery ( ) ) { if ( resultConsumer != null ) { success = resultConsumer . accept ( value , resultSet ) ; if ( ! success ) break ; } } } } return this ; }
execute a sql prepared query .
