THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The following code snippet illustrates the usage (refer to HIVE-6486 for a complete test case):
Code Block | ||
---|---|---|
| ||
static Connection getConnection( Subject signedOnUserSubject ) throws Exception{ Connection conn = (Connection) Subject.doAs(signedOnUserSubject, new PrivilegedExceptionAction<Object>() { { public Object run() { public Object run() Connection con = null; { String JDBC_DB_URL = "jdbc:hive2://HiveHost:10000/default;" || Connection con = null; String JDBC_DB_URL = "jdbc:hive2://HiveHost:10000/default;principal=hive/localhost.localdomain@EXAMPLE.COM;auth=kerberos;kerberosAuthType=fromSubject"; " || try { "auth=kerberos;kerberosAuthType=fromSubject"; try { Class.forName(JDBC_DRIVER); con = DriverManager.getConnection(JDBC_DB_URL); ; } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return con; } }); }}; return conn; |
Python Client
...