Use spring and hibernate.