import java.sql.*;
import java.util.Map;
import java.util.Date;

public class Example {


	public static void main(String[] args) throws Exception {
		
		final String connOptions = "ssl=true;sslTrustStore=./truststore.jks;trustStorePassword=mypassword;";
		
		// Hostname, Username and Password are passed in through the environment

		Map<String, String> env = System.getenv();

		final String db = String.format(
				"jdbc:hive2://%s:10000/default;%s", env.get("hostname"), connOptions
				);

		final String user = env.get("username");
		final String pwd  = env.get("password");


		Connection conn = null;
		Statement stmt = null;

		Class.forName("org.apache.hive.jdbc.HiveDriver");

		conn = DriverManager.getConnection(db, user, pwd);

		stmt = conn.createStatement();

        String tmpTableName = String.format("%s_temp_%s",
                    env.get("username"),
                    new Date().getTime()
                    );

        stmt.execute(
                String.format("create table %s ( id int, name string )", tmpTableName)
                );
		
        stmt.execute(
                String.format("drop table %s", tmpTableName)
                );
		
		stmt.close();
		conn.close();

		System.out.println("\n>> Connectivity test was successful.");
	}
}

@@ -82,17 +82,16 @@
 mple %7B%0A%0A
-%0A
 %09public 
@@ -144,16 +144,77 @@
 on %7B%0A%09%09%0A
+%09%09// truststore.jks is created by the build.gradle script%0A%09%09%0A
 %09%09final 
@@ -834,24 +834,25 @@
 );%0A%0A        
+%09
 String tmpTa
@@ -995,32 +995,33 @@
     );%0A%0A        
+%09
 stmt.execute(%0A  
@@ -1023,32 +1023,33 @@
 e(%0A             
+%09
    String.format
@@ -1136,16 +1136,17 @@
         
+%09
 stmt.exe
@@ -1158,24 +1158,25 @@
 %0A           
+%09
      String.

Update Example.java