首页 > 解决方案 > 带有身份验证的代理后面的 Presto 连接

问题描述

我正在尝试使用 JDBC 驱动程序连接到 presto,但是当我运行该过程时,我得到:

Error Cause java.io.UncheckedIOException: java.io.IOException: Failed to authenticate with proxy

我在文档中看到我们可以传递属性httpProxy但没有如何将身份验证传递给它。

我正在使用这个版本:0.239.1

String url = "jdbc:presto://MY-SERVER:PORT/dal_hms_prod/default?user=USERNAME&password=PASSWORD&SSL=true";
Properties properties = new Properties();
properties.setProperty("httpProxy", "PROXY_SERVER:PORT");
Connection connection = DriverManager.getConnection(url, properties);
log.info("Connection stablished "+connection.getSchema());
Statement stmt = connection.createStatement();
String sql = "select test from usersource.usersource_flat limit 1;";
ResultSet res = stmt.executeQuery(sql);

希望有人能给我一些见解。谢谢。

标签: javaproxypresto

解决方案


推荐阅读