5.Hibernate implementation of a full set of additions and deletions and Ajax asynchronous paging

Source: Internet
Author: User

1.1 Create the following Oracle database script

1 Dropsequence seq_stu;2 3 Createsequence Seq_stu4MinValue15MaxValue9999999999999999999999999996Start with 17Increment by 18Cache -;9 Ten Drop Tablestudent; One  A Create TableSTUDENT - ( -Sid Number  not NULL, theSnameVARCHAR2( -) not NULL, -PasswordVARCHAR2( -)default '123', -SexVARCHAR2(Ten)default 'female', -Cid Number  not NULL + ); - Alter TableSTUDENT +   Add constraintPk_sidPrimary Key(SID); A    at Alter TableSTUDENT -   Add constraintCk_student_cid -   Check(CIDbetween 1  and  -); -  - Insert  intoSTUDENT (SID, Sname, password, sex, CID) - Values(Seq_stu. Nextval,'absconded','123','male',1); in Insert  intoSTUDENT (SID, Sname, password, sex, CID) - Values(Seq_stu. Nextval,'Zhou Qiang','123','male',1); to Insert  intoSTUDENT (SID, Sname, password, sex, CID) + Values(Seq_stu. Nextval,'Shidon','123','male',1); - Insert  intoSTUDENT (SID, Sname, password, sex, CID) the Values(Seq_stu. Nextval,'Handsome Tianwei','123','male',2); * Insert  intoSTUDENT (SID, Sname, password, sex, CID) $ Values(Seq_stu. Nextval,'Tom Shuai','123','male',2);Panax Notoginseng Insert  intoSTUDENT (SID, Sname, password, sex, CID) - Values(Seq_stu. Nextval,'Liuliang','123','male',2); the Insert  intoSTUDENT (SID, Sname, password, sex, CID) + Values(Seq_stu. Nextval,'Li Jie','123','male',3); A Insert  intoSTUDENT (SID, Sname, password, sex, CID) the Values(Seq_stu. Nextval,'Tourneau','123','male',3); + Insert  intoSTUDENT (SID, Sname, password, sex, CID) - Values(Seq_stu. Nextval,'Karaganda','123','male',3); $ Insert  intoSTUDENT (SID, Sname, password, sex, CID) $ Values(Seq_stu. Nextval,'Wen Bao','123','male',4); - Insert  intoSTUDENT (SID, Sname, password, sex, CID) - Values(Seq_stu. Nextval,'Cheng','123','female',4); the Insert  intoSTUDENT (SID, Sname, password, sex, CID) - Values(Seq_stu. Nextval,'Lu Yu','123','male',4);Wuyi Insert  intoSTUDENT (SID, Sname, password, sex, CID) the Values(Seq_stu. Nextval,'Holly','123','female',4); - Commit; Wu  - --Modify list column names only rename About Alter TableStudent RenamecolumnSsex tosex; $  - Select *  fromstudent; -  - Commit;
Student.sql

1.2 Create the following project structure

1.3 Create a hibernate.cfg.xml under the SRC root of the project

1.4 Create Student.java under the Com.entity package under Project SRC

1.5 Create the Student.hbm.xml mapping file under the Com.entity package under SRC for the project

1.6 Create Page.java under the Com.page package under Project SRC

1.7 Create Hibernate_util.java under the Com.util package under Project SRC

1.8 Create Studentdao.java under the Com.dao package under Project SRC

1.9 Create Studentdaoimpl.java under the Com.dao.impl package under Project SRC

1.10 Create Studentservice.java under the Com.service package under Project SRC

1.11 Create Studentserviceimpl.java under the Com.service.impl package under Project SRC

1. Create the Loginservlet.java under the Com.servlet package under the project SRC

1. Create the Registerservlet.java under the Com.servlet package under the project SRC

1. Create the Findallservlet.java under the Com.servlet package under the project SRC

1. Create the Findbyidserlvet.java under the Com.servlet package under the project SRC

1. Create the Updateservlet.java under the Com.servlet package under the project SRC

1. Create the Deleteserlvet.java under the Com.servlet package under the project SRC

1. Create the Findpageservlet.java under the Com.servlet package under the project SRC

1. Create the Test.java under the Com.test package under the project SRC

5.Hibernate implementation of a full set of additions and deletions and Ajax asynchronous paging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.