67,537
社区成员
发帖
与我相关
我的任务
分享drop table person;
create table person(
id varchar(32) not null primary key,
name varchar(20) not null,
password varchar(20) not null
);
commit;public static void main(String[] args) {
ApplicationContext ctx=null;
ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
PersonDAOImpel pdl=(PersonDAOImpel)ctx.getBean("persondao");
Person per=new Person();
per.setName("张三");
per.setPassword("454654");
pdl.insert(per);
}package com.guoc.ssh.impel;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.guoc.ssh.vo.Person;
public class PersonDAOImpel extends HibernateDaoSupport {
public void insert(Person per){
this.getSession().save(per);
}
}