/** * Return the password associated with the given principal's user name. * @param dbConnection The database connection to be used * @param username Username for which password should be retrieved * @return the password for the specified user */ protected String getPassword(Connection dbConnection, String username) { String dbCredentials = null; try (PreparedStatement stmt = credentials(dbConnection, username); ResultSet rs = stmt.executeQuery()) { if (rs.next()) { dbCredentials = rs.getString(1); } return (dbCredentials != null) ? dbCredentials.trim() : null; } catch (SQLException e) { containerLog.error( sm.getString("dataSourceRealm.getPassword.exception", username), e); } return null; }
/** * Return the password associated with the given principal's user name. * @param dbConnection The database connection to be used * @param username Username for which password should be retrieved * @return the password for the specified user */ protected String getPassword(Connection dbConnection, String username) { String dbCredentials = null; try (PreparedStatement stmt = credentials(dbConnection, username); ResultSet rs = stmt.executeQuery()) { if (rs.next()) { dbCredentials = rs.getString(1); } return (dbCredentials != null) ? dbCredentials.trim() : null; } catch (SQLException e) { containerLog.error( sm.getString("dataSourceRealm.getPassword.exception", username), e); } return null; }
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {
stmt = credentials(dbConnection, username); rs = stmt.executeQuery(); if (rs.next()) {