先添加 1.添加hibernate支持。 2.添加spring支持。 3.添加spring的jdbc的jar包。 4.在applicationContext.xml中new datasource和sessionFactory。