System.out.println("Metastore connection URL:\t " + connectionURL);
System.out.println("Metastore Connection Driver :\t " + driver);
System.out.println("Metastore connection User:\t " + userName);
}
if ((userName == null) || userName.isEmpty()) {
throw new HiveMetaException("UserName empty ");
}
// load required JDBC driver
Class.forName(driver);
// Connect using the JDBC URL and user/pass from conf
return DriverManager.getConnection(connectionURL, userName, passWord);
} catch (IOException e) {
throw new HiveMetaException("Failed to get schema version.", e);
} catch (SQLException e) {
throw new HiveMetaException("Failed to get schema version.", e);
} catch (ClassNotFoundException e) {
throw new HiveMetaException("Failed to load driver", e);
}
}