Sinclair Ferguson, commenting on Daniel 9 in his commentary on Daniel, pp. 177-178:
‘Daniel’s praying was of the same order [as that of Elijah, cited by James] as his appeal to the “righteousness” of God eloquently testifies (vv. 7, 16). The Old Testament term “righteousness” has a specifically covenantal orientation. The young Martin Luther could not see this when he struggled to understand what Paul meant by “the righteousness of God” (Rom. 1:17). Of course, Luther was not helped by the fact that his Latin Bible translated Paul’s Greek word dikaiosune (righteousness) as justitia (justice). Luther’s mistake has sometimes been repeated by evangelical Christians. Often righteousness has been thought of merely as the equivalent of the just punishment of God. Preachers therefore may often accompany the use of the phrase “the righteousness of God” with the gesticulation of a clenched fist. It is clear even from this passage, however, that this is to reduce the full biblical meaning of God’s righteousness. Daniel sees the righteousness of God both as the basis for God’s judgment of the people (v. 7) and also as the basis for his own prayer for forgiveness (v. 16). How can this be? In Scripture, “righteousness” basically means “integrity.” Sometimes it is defined as “conformity to a norm.” In the case of God, the norm to which he conforms is his own being and character. He is true to himself; he always acts in character.
‘God has expressed the norm of his relationship to his people by means of a covenant. He will always be true and faithful to his covenant and the promises enshrined in it. Plainly, God’s righteousness is his faithfulness to his covenant relationship.
‘Daniel underlines God’s faithfulness to his covenantal promise to punish the covenant-breaking of his people: “O Lord, righteousness belongs to you, but to us shame of face… Yes, all Israel has transgressed your law, and has departed [from the covenant] so as not to obey your voice; therefore the curse and the oath written in the Law of Moses… has been poured out on us because we have sinned against him… Therefore the Lord has kept the disaster in mind, and brought it upon us; for the Lord our God is righteous in all the works which he does, though we have not obeyed his voice” (vv. 7-14). In contrast, the same righteousness of God is made the ground for Daniel’s appeal for mercy because he knows that God has promised to receive his penitent people and to restore them to fellowship with himself. His covenant righteousness holds out the hope of forgiveness, and Daniel clings to this with his whole heart: “O Lord, according to all your righteousness… let your anger and your fury be turned away… because of our sins… your people are a reproach to all those around us” (v. 16).’