Presto Jdbc Connection gives Error executing query

4.8k Views Asked by At

We are trying to execute presto jdbc connection . We have followed the simple example in

https://www.tutorialspoint.com/apache_presto/apache_presto_jdbc_interface.htm

  • Added the jar ,
  • run as java application in eclipse .

note :

  • Presto is installed in the linux server . presto cli is working fine in the linux . Started presto in linux .
  • We are running this class in Windows machine eclipse ide. We have no firewall in the linux machine .
  • Mysql is also installed in the linux machine . We are able to access mysql in windows using java code . but unable to do it from windows .

Also tried adding ssl =true as shown below connection = DriverManager.getConnection("jdbc:presto://19.255.24.127:8080/mysql/tutorials?user=root&password=Redcar88!&SSL=true");

Exception : java.sql.SQLException: Error executing query at com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:279) at com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:228) at com.facebook.presto.jdbc.PrestoStatement.executeQuery(PrestoStatement.java:77) at testdbPresto.PrestoJdbcSample.main(PrestoJdbcSample.java:22) Caused by: java.io.UncheckedIOException: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message at com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:154) at com.facebook.presto.jdbc.internal.client.StatementClientV1.(StatementClientV1.java:130) at com.facebook.presto.jdbc.internal.client.StatementClientFactory.newStatementClient(StatementClientFactory.java:24) at com.facebook.presto.jdbc.QueryExecutor.startQuery(QueryExecutor.java:46) at com.facebook.presto.jdbc.PrestoConnection.startQuery(PrestoConnection.java:717) at com.facebook.presto.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:240) ... 3 more Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message at sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:448) at sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:174) at sun.security.ssl.SSLTransport.decode(SSLTransport.java:110) at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1279) at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1188) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:401) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:373) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:299) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:268) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.RealConnection.connect(RealConnection.java:160) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113) at com.facebook.presto.jdbc.internal.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.facebook.presto.jdbc.internal.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.facebook.presto.jdbc.internal.client.OkHttpUtil.lambda$basicAuth$1(OkHttpUtil.java:91) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.facebook.presto.jdbc.internal.client.OkHttpUtil.lambda$userAgent$0(OkHttpUtil.java:77) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at com.facebook.presto.jdbc.internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.facebook.presto.jdbc.internal.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200) at com.facebook.presto.jdbc.internal.okhttp3.RealCall.execute(RealCall.java:77) at com.facebook.presto.jdbc.internal.client.JsonResponse.execute(JsonResponse.java:131) ... 8 more

config.properties of presto installation . enter image description here In the code i'm using the ip of the machine as Host .

0

There are 0 best solutions below