Download Brochure

Monday, 10 September 2018

Hibernate program for IT / CS students of Mumbai University

//here is the hibernate class which creates the table called ‘Student’ in eclipse.
/*All variables are private whereas method are public. This is to ensure that data cannot be accessed by other class, whereas these method can be used in other class as they care public*/ 

import javax.persistence.*;

@Entity
public class Student {
       @Id
       @Column(name="RollNo")
       private int rid;
       @Column
       private String fname;
       @Column
       private String lname;
       @Column
       private String dob;
       @Column
       private String gender;
       public int getRid() {
              return rid;
       }
       public void setRid(int rid) {
              this.rid = rid;
       }
       public String getFname() {
              return fname;
       }
       public void setFname(String fname) {
              this.fname = fname;
       }
       public String getLname() {
              return lname;
       }
       public void setLname(String lname) {
              this.lname = lname;
       }
       public String getDob() {
              return dob;
       }
       public void setDob(String dob) {
              this.dob = dob;
       }
       public String getGender() {
              return gender;
       }
       public void setGender(String gender) {
              this.gender = gender;
       }

}


Inserting into database, following screenshot


Created by Ankita Bamania, edited by Dr. Ashwin I Mehta

For more details contact Vissicomp Technology 9320957717/718

About the Author

Vissicomp Technology

About Vissicomp

Vissicomp Technology- Sharpens your IT edge

0 comments:

Post a Comment

Special Navratri Offer Starts from 26th Sept. to 10th Oct. 2022. Join Any Course ...

  𝗛𝗨𝗥𝗥𝗬 𝗨𝗣!! Special Navratri Offer .. Grab This Opportunity Navratri Offer Get 10% Off For Any Course Registration Offline 100% Jo...

 

VISSICOMP TECHNOLOGY © 2015 - Blogger Templates Designed by Templateism.com, Plugins By MyBloggerLab.com