public static void closeStatement(PreparedStatement preparedStatement) { IdentityDatabaseUtil.closeStatement(preparedStatement); }
public static void closeStatement(PreparedStatement preparedStatement) { IdentityDatabaseUtil.closeStatement(preparedStatement); }
private void deleteClaimAttributeMappings(Connection connection, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; try { String query = SQLConstants.DELETE_CLAIM_MAPPED_ATTRIBUTE; prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, tenantId); prepStmt.execute(); } catch (SQLException e) { throw new ClaimMetadataException("Error while deleting attribute mappings", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void updateTokenIdIfAutzCodeGrantType(String oldAccessTokenId, String newAccessTokenId, Connection connection) throws IdentityOAuth2Exception { PreparedStatement prepStmt = null; try { String updateNewTokenAgaintAuthzCodeSql = SQLQueries.UPDATE_NEW_TOKEN_AGAINST_AUTHZ_CODE; prepStmt = connection.prepareStatement(updateNewTokenAgaintAuthzCodeSql); prepStmt.setString(1, newAccessTokenId); prepStmt.setString(2, oldAccessTokenId); prepStmt.executeUpdate(); } catch (SQLException e) { throw new IdentityOAuth2Exception("Error while updating Access Token against authorization code for " + "access token with ID : " + oldAccessTokenId, e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void addClaimMapping(Connection connection, int externalClaimId, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; String query = SQLConstants.ADD_CLAIM_MAPPING; try { prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, externalClaimId); prepStmt.setInt(3, tenantId); prepStmt.executeUpdate(); } catch (SQLException e) { throw new ClaimMetadataException("Error while adding claim mapping", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void deleteClaimProperties(Connection connection, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; try { String query = SQLConstants.DELETE_CLAIM_PROPERTY; prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, tenantId); prepStmt.execute(); } catch (SQLException e) { throw new ClaimMetadataException("Error while deleting claim properties", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } } }
private void deleteClaimAttributeMappings(Connection connection, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; try { String query = SQLConstants.DELETE_CLAIM_MAPPED_ATTRIBUTE; prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, tenantId); prepStmt.execute(); } catch (SQLException e) { throw new ClaimMetadataException("Error while deleting attribute mappings", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } } }
private void updateClaimMapping(Connection connection, int externalClaimId, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; String query = SQLConstants.UPDATE_CLAIM_MAPPING; try { prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, externalClaimId); prepStmt.setInt(3, tenantId); prepStmt.executeUpdate(); } catch (SQLException e) { throw new ClaimMetadataException("Error while updating claim mapping", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void updateClaimMapping(Connection connection, int externalClaimId, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; String query = SQLConstants.UPDATE_CLAIM_MAPPING; try { prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, externalClaimId); prepStmt.setInt(3, tenantId); prepStmt.executeUpdate(); } catch (SQLException e) { throw new ClaimMetadataException("Error while updating claim mapping", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void addClaimMapping(Connection connection, int externalClaimId, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; String query = SQLConstants.ADD_CLAIM_MAPPING; try { prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, externalClaimId); prepStmt.setInt(3, tenantId); prepStmt.executeUpdate(); } catch (SQLException e) { throw new ClaimMetadataException("Error while adding claim mapping", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void updateClaimMapping(Connection connection, int externalClaimId, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; String query = SQLConstants.UPDATE_CLAIM_MAPPING; try { prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, externalClaimId); prepStmt.setInt(3, tenantId); prepStmt.executeUpdate(); } catch (SQLException e) { throw new ClaimMetadataException("Error while updating claim mapping", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } }
private void deleteClaimAttributeMappings(Connection connection, int localClaimId, int tenantId) throws ClaimMetadataException { PreparedStatement prepStmt = null; try { String query = SQLConstants.DELETE_CLAIM_MAPPED_ATTRIBUTE; prepStmt = connection.prepareStatement(query); prepStmt.setInt(1, localClaimId); prepStmt.setInt(2, tenantId); prepStmt.execute(); } catch (SQLException e) { throw new ClaimMetadataException("Error while deleting attribute mappings", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); } } }
private void addUserDataValue(String userName, int tenantId, String key, String value) throws SQLException { Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; try { prepStmt = connection.prepareStatement(SQLQuery.STORE_USER_DATA); prepStmt.setInt(1, tenantId); prepStmt.setString(2, userName); prepStmt.setString(3, key); prepStmt.setString(4, value); prepStmt.execute(); connection.commit(); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); IdentityDatabaseUtil.closeConnection(connection); } }
private void addUserDataValue(String userName, int tenantId, String key, String value) throws SQLException { Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; try { prepStmt = connection.prepareStatement(SQLQuery.STORE_USER_DATA); prepStmt.setInt(1, tenantId); prepStmt.setString(2, userName); prepStmt.setString(3, key); prepStmt.setString(4, value); prepStmt.execute(); connection.commit(); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); IdentityDatabaseUtil.closeConnection(connection); } }
private void addUserDataValue(String userName, int tenantId, String key, String value) throws SQLException { Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; try { prepStmt = connection.prepareStatement(SQLQuery.STORE_USER_DATA); prepStmt.setInt(1, tenantId); prepStmt.setString(2, userName); prepStmt.setString(3, key); prepStmt.setString(4, value); prepStmt.execute(); connection.commit(); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); IdentityDatabaseUtil.closeConnection(connection); } }
private void addUserDataValue(String userName, int tenantId, String key, String value) throws SQLException { Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; try { prepStmt = connection.prepareStatement(SQLQuery.STORE_USER_DATA); prepStmt.setInt(1, tenantId); prepStmt.setString(2, userName); prepStmt.setString(3, key); prepStmt.setString(4, value); prepStmt.execute(); connection.commit(); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); IdentityDatabaseUtil.closeConnection(connection); } }
public static void closeAllConnections(Connection dbConnection, ResultSet rs, PreparedStatement prepStmt) { closeResultSet(rs); closeStatement(prepStmt); closeConnection(dbConnection); }
public static void closeAllConnections(Connection dbConnection, ResultSet rs, PreparedStatement prepStmt) { closeResultSet(rs); closeStatement(prepStmt); closeConnection(dbConnection); }
@Override public void invalidate(String code) throws IdentityException { Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement prepStmt = null; try { prepStmt = connection.prepareStatement(SQLQuery.INVALIDATE_METADATA_FROM_CODE); prepStmt.setString(1, code.toLowerCase()); prepStmt.execute(); connection.commit(); } catch (SQLException e) { throw IdentityException.error("Error while invalidating user identity data for code: " + code, e); } finally { IdentityDatabaseUtil.closeStatement(prepStmt); IdentityDatabaseUtil.closeConnection(connection); } }
public static void closeAllConnections(Connection dbConnection, ResultSet rs, PreparedStatement prepStmt) { closeResultSet(rs); closeStatement(prepStmt); closeConnection(dbConnection); }