Source:
<code>public Connection getConnection(String dbPrefix, InterpreterContext context) throws ClassNotFoundException, SQLException, InterpreterException, IOException { final String user = context.getAuthenticationInfo().getUser(); Connection connection; if (dbPrefix == null || basePropertiesMap.get(dbPrefix) == null) { return null; } JDBCUserConfigurations jdbcUserConfigurations = getJDBCConfiguration(user); setUserProperty(dbPrefix, context); final Properties properties = jdbcUserConfigurations.getPropertyMap(dbPrefix); String url = properties.getProperty(URL_KEY); <START> String principal = getProperty("zeppelin.jdbc.principal"); <END> if (!StringUtils.isBlank(principal) && !url.contains("principal=")) { url = url + ";principal=" + principal; } if (isEmpty(getProperty("zeppelin.jdbc.auth.type"))) { connection = getConnectionFromPool(url, user, dbPrefix, properties); } else { UserGroupInformation.AuthenticationMethod authType = JDBCSecurityImpl.getAuthType(getProperties()); final String connectionUrl = appendProxyUserToURL(url, user, dbPrefix); JDBCSecurityImpl.createSecureConfiguration(getProperties(), authType); if (basePropertiesMap.get(dbPrefix).containsKey("proxy.user.property")) { connection = getConnectionFromPool(connectionUrl, user, dbPrefix, properties); } else { UserGroupInformation ugi = null; try { ugi = UserGroupInformation.createProxyUser( user, UserGroupInformation.getCurrentUser()); } catch (Exception e) { LOGGER.error("Error in getCurrentUser", e); throw new InterpreterException("Error in getCurrentUser", e); } final String poolKey = dbPrefix; try { connection = ugi.doAs((PrivilegedExceptionAction<Connection>) () -> getConnectionFromPool(connectionUrl, user, poolKey, properties)); } catch (Exception e) { LOGGER.error("Error in doAs", e); throw new InterpreterException("Error in doAs", e); } } } return connection; }</code><technical_language>I notice this earlier, if I remove lines, starts working expected</technical_language>

Target:
public Connection getConnection(String dbPrefix, InterpreterContext context) throws ClassNotFoundException, SQLException, InterpreterException, IOException { final String user = context.getAuthenticationInfo().getUser(); Connection connection; if (dbPrefix == null || basePropertiesMap.get(dbPrefix) == null) { return null; } JDBCUserConfigurations jdbcUserConfigurations = getJDBCConfiguration(user); setUserProperty(dbPrefix, context); final Properties properties = jdbcUserConfigurations.getPropertyMap(dbPrefix); String url = properties.getProperty(URL_KEY); if (isEmpty(getProperty("zeppelin.jdbc.auth.type"))) { connection = getConnectionFromPool(url, user, dbPrefix, properties); } else { UserGroupInformation.AuthenticationMethod authType = JDBCSecurityImpl.getAuthType(getProperties()); final String connectionUrl = appendProxyUserToURL(url, user, dbPrefix); JDBCSecurityImpl.createSecureConfiguration(getProperties(), authType); if (basePropertiesMap.get(dbPrefix).containsKey("proxy.user.property")) { connection = getConnectionFromPool(connectionUrl, user, dbPrefix, properties); } else { UserGroupInformation ugi = null; try { ugi = UserGroupInformation.createProxyUser( user, UserGroupInformation.getCurrentUser()); } catch (Exception e) { LOGGER.error("Error in getCurrentUser", e); throw new InterpreterException("Error in getCurrentUser", e); } final String poolKey = dbPrefix; try { connection = ugi.doAs((PrivilegedExceptionAction<Connection>) () -> getConnectionFromPool(connectionUrl, user, poolKey, properties)); } catch (Exception e) { LOGGER.error("Error in doAs", e); throw new InterpreterException("Error in doAs", e); } } } return connection; }