Configuring Virtual Private Cloud (VPC) Services
You can configure the connector to connect to Presto using a Virtual Private Cloud (VPC) service. To do this, use the following connection properties:
SocketFactorySocketFactoryArgDnsResolverDnsResolverArg
The SocketFactory property extends javax.net.SocketFactory, and the DnsResolver property implements com.interfaces.networking.CustomDnsResolver. The SocketFactoryArg and DnsResolverArg properties pass any required arguments to these services.
The properties in the following instructions are all optional, and only need to be used if you are connecting through the relevant service.
To configure the connector to use a VPC:
- If necessary, set the
SocketFactoryproperty to the fully-qualified class path for a class that extendsjavax.net.SocketFactoryand provides the socket factory implementation. - If necessary, set the
SocketFactoryArgto a string argument to pass to the constructor of the class indicated by theSocketFactoryproperty. - If necessary, set the
DnsResolverproperty to the fully-qualified class path for a class that extends theDnsResolverinterface for the connector,com.interfaces.networking.CustomDnsResolver. - If necessary, set the
DnsResolverArgto a string argument to pass to the constructor of the class indicated by theDnsResolverproperty.
For example, the following connection URLs show how to connect to data sources using the supported VPCs.
Using SocketFactory:
jdbc:presto://192.168.203.141:8080;User=simba;SocketFactory=com.simba.junit.jdbc.utils.CustomSocketFactory;SocketFactoryArg=Args;
Using DnsResolver:
jdbc:presto://192.168.203.141:8080;User=simba;DnsResolver=com.simba.junit.jdbc.utils.TestDnsResolver;DnsResolverArg=agrs;
Using both SocketFactory and DnsResolver:
jdbc:presto://192.168.203.141:8080;User=simba;DnsResolver=com.simba.junit.jdbc.utils.TestDnsResolver;DnsResolverArg=Agrs;SocketFactory=com.simba.junit.jdbc.utils.CustomSocketFactory;SocketFactoryArg=Args;