I have heard that on one occasion the Blessed One was staying among the Sakyans at Kapilavatthu in the Banyan Park. Now at that time the Blessed One had just recovered from being ill, was not long recovered from his illness. Then Mahanama the Sakyan went to the Blessed One and, on arrival, having bowed down, sat to one side. As he was sitting there he said to the Blessed One: "For a long time I have known the Dhamma taught by the Blessed One that 'There is knowledge for one who is concentrated, not for one who is not concentrated.' Now, does concentration come first, and knowledge after, or does knowledge come first, and concentration after?"
Then the thought occurred to Ven. Ananda, "Here the Blessed One has just recovered from being ill, is not long recovered from his illness, and yet Mahanama the Sakyan asks him this very deep question. What if I were to take Mahanama the Sakyan to one side and teach him the Dhamma?" So Ven. Ananda, taking Mahanama the Sakyan by the arm, led him to one side and said to him, "Mahanama, the Blessed One has talked both of the virtue of one who is in training [a stream-winner, a once-returner, or a non-returner] and of the virtue of one whose training is complete [an arahant]. He has talked both of the concentration of one who is in training and of the concentration of one whose training is complete. He has talked both of the discernment of one who is in training and of the discernment of one whose training is complete.
"And what is the virtue of one who is in training? There is the case where a monk is virtuous. He dwells restrained in accordance with the Patimokkha, consummate in his behavior & sphere of activity. He trains himself, having undertaken the training rules, seeing danger in the slightest fault. This is called the virtue of one who is in training.
"And what is the concentration of one who is in training? There is the case where a monk — quite withdrawn from sensuality, withdrawn from unskillful [mental] qualities — enters & remains in the first jhana: rapture & pleasure born from withdrawal, accompanied by directed thought & evaluation. With the stilling of directed thoughts & evaluations, he enters & remains in the second jhana: rapture & pleasure born of composure, unification of awareness free from directed thought & evaluation — internal assurance. With the fading of rapture, he remains equanimous, mindful, & alert, and senses pleasure with the body. He enters & remains in the third jhana, of which the Noble Ones declare, 'Equanimous & mindful, he has a pleasant abiding.' With the abandoning of pleasure & pain — as with the earlier disappearance of elation & distress — he enters & remains in the fourth jhana: purity of equanimity & mindfulness, neither pleasure nor pain. This is called the concentration of one who is in training.
"And what is the discernment of one who is in training? There is the case where a monk discerns as it actually is that 'This is stress... This is the origination of stress... This is the cessation of stress... This is the path of practice leading to the cessation of stress.' This is called the discernment of one who is in training.
"Then there is the disciple of the noble ones — thus consummate in virtue, thus consummate in concentration, thus consummate in discernment — who, through the ending of the mental fermentations, enters & remains in the fermentation-free awareness-release & discernment-release, having known & made them manifest for himself right in the here & now.
"In this way, Mahanama, the Blessed One has talked both of the virtue of one who is in training and of the virtue of one whose training is complete. He has talked both of the concentration of one who is in training and of the concentration of one whose training is complete. He has talked both of the discernment of one who is in training and of the discernment of one whose training is complete."