What does it mean that Jesus was the "second Adam"? I often hear Jesus referred to as the "second Adam" or sometimes as the "last Adam". What meaning does this title carry? Does it mean that things didn't work out so well for Adam and so God had to try again?

I can't find a verse that uses "second Adam", but this verse mentions the "last Adam":


  1 Corinthians 15:45 (ESV)
  Thus it is written, “The first man Adam became a living being”; the last Adam became a life-giving spirit.


Is this talking about Adam? Where else is this address used and why is it important?
1 Cor. 15:22, 45

22 For as in Adam all die, even so in Christ all shall be made alive. . . .
45 And so it is written, &quot;The first man Adam became a living being.&quot; The last Adam became a life-giving spirit.

The specific reference is to obedience; The first Adam was the father of all men through the Flesh and disobeyed, and through him all of his progeny learned disobedience and inherited death, whereas the 'second' or 'last' Adam becomes the father of all men through the Spirit, and was perfect in obedience. Through him, all his progeny learn to be obedient to the will of God and inherit life.
See also, related:
Romans 5:12-21 NIV

12 Therefore, just as sin entered the world through one man, and death through sin, and in this way death came to all men, because all sinned-- 13 for before the law was given, sin was in the world. But sin is not taken into account when there is no law. 14 Nevertheless, death reigned from the time of Adam to the time of Moses, even over those who did not sin by breaking a command, as did Adam, who was a pattern of the One to come.
15 But the gift is not like the trespass. For if the many died by the trespass of the one man, how much more did God's grace and the gift that came by the grace of the one man, Jesus Christ, overflow to the many! 16 Again, the gift of God is not like the result of the one man's sin: The judgment followed one sin and brought condemnation, but the gift followed many trespasses and brought justification.
17 For if, by the trespass of the one man, death reigned through that one man, how much more will those who receive God's abundant provision of grace and of the gift of righteousness reign in life through the one man, Jesus Christ. 18 Consequently, just as the result of one trespass was condemnation for all men, so also the result of one act of righteousness was justification that brings life for all men.
19 For just as through the disobedience of the one man the many were made sinners, so also through the obedience of the one man the many will be made righteous. 20 The law was added so that the trespass might increase. But where sin increased, grace increased all the more, 21 so that, just as sin reigned in death, so also grace might reign through righteousness to bring eternal life through Jesus Christ our Lord.


I believe 'The Second Adam' is an interpolation, i.e, a term that is not explicitly in the scripture like 'Trinity' but enjoys common usage because of its descriptive faculty.