The first solution is a common net. After that move black cannot get out.
$$W Black is in atari
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X C . . .
$$ | . X O X 4 5 . .
$$ | . O O 2 1 . . .
$$ | . . . 3 . . X .
$$ | . . . . X . . .
$$ | . . . . . . . .
- Click Here To Show Diagram Code
[go]$$W Black is in atari
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X C . . .
$$ | . X O X 4 5 . .
$$ | . O O 2 1 . . .
$$ | . . . 3 . . X .
$$ | . . . . X . . .
$$ | . . . . . . . .[/go]
As for the second solution, it doesn't seem to work. It may also be net, but looser and more complicated. As Kageyama teaches in
Lessons in the Fundamentals of Go, if there are two options to capture your opponent's stones, always choose the firmer of the two. The first solution should always be played in this situation.
Black 2 seems to be the move to get out. Without the marked black stone it doesn't work because of something like the cross-cut tesuji. Since that black stone is there, however, it does. White 3 doesn't seem to do anything to prevent black from connecting and it doesn't. Black 4 connects back to the marked stone.
$$W
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X . . . .
$$ | . X O X 3 . . .
$$ | . O O 4 2 1 . .
$$ | . . . . . . X .
$$ | . . . . B . . .
$$ | . . . . . . . .
- Click Here To Show Diagram Code
[go]$$W
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X . . . .
$$ | . X O X 3 . . .
$$ | . O O 4 2 1 . .
$$ | . . . . . . X .
$$ | . . . . B . . .
$$ | . . . . . . . .[/go]
If the marked stone is not there here is how the solution works. If black cross-cuts white just captures the black cutting stones.
$$W
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X C . . .
$$ | . X O X 6 7 . .
$$ | . O O 5 2 1 . .
$$ | . . . . 3 4 X .
$$ | . . . . . . . .
$$ | . . . . . . . .
- Click Here To Show Diagram Code
[go]$$W
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X C . . .
$$ | . X O X 6 7 . .
$$ | . O O 5 2 1 . .
$$ | . . . . 3 4 X .
$$ | . . . . . . . .
$$ | . . . . . . . .[/go]
If black tries to force his way out, white still captures the cutting stones.
$$W
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X 6 7 . .
$$ | . X O X C . . .
$$ | . O O 4 2 1 . .
$$ | . . . 5 3 . X .
$$ | . . . . . . . .
$$ | . . . . . . . .
- Click Here To Show Diagram Code
[go]$$W
$$ ------------------
$$ | . . . . . . . .
$$ | . X X . . . . .
$$ | . . X O O . X .
$$ | . X O X 6 7 . .
$$ | . X O X C . . .
$$ | . O O 4 2 1 . .
$$ | . . . 5 3 . X .
$$ | . . . . . . . .
$$ | . . . . . . . .[/go]