Nope. The solutions to these two problems are not the same.
The first problem is a boundary value problem, meaning the solution is defined at the two endpoints x=0 and x=2 of the domain of definition.
The second problem is an initial value problem, where the values for y and y' are fixed at the initial point x=0.
The first problem is likely to have a periodical solution, the second most surely not.
Anyway, its a lazy Sunday, I trust theis info is enough.