**Edit:** There is an interesting complete answer for the second part(see the answer by Thomas Kragh). I search for an answer for the first part.

1.Is there a polynomial Hamiltonian $H:\mathbb{R}^{4}\to \mathbb{R}$ such that the number of nontrivial periodic orbits of the corresponding Hamiltonian vector field $X_{H}$ is finite but different from zero?

2.Is it possible to construct an example of the above situation with the additional condition that $H$ has the form $H(x,y,z,w)=zP(x,y)+wQ(x,y)$, where $P,Q$ are polynomials?

The motivation for the second part of the question is that, for such particular Hamiltonian, the first two components of $X_{H}$ is a polynomial planar vector field on the $x-y$ plane. On the other hand, a generic algebraic vector field on $\mathbb{R}^{2}$ has only a finite number of periodic orbits.

By non trivial periodic orbit, I mean, a periodic solution which minimum period is non zero.(That is a periodic orbit not a singular point).