Posts

Showing posts from February, 2022
Image
  JDBC 5: IMPORTANT Inside the parent table/class (exhibition), define a constructor which contains one argument as a list of all the records in the child table (stall) related to each exhibition. See the code for clarification. public class Stall { private Long id;     private String name;     private String detail;     private String owner;     private Exhibition exhibition;     public Stall(){}     public Stall(Long id,String name,String detail,String owner,Exhibition exhibition){         this.id=id;         this.name=name;         this.detail=detail;         this.owner=owner;         this.exhibition=exhibition;     }     public Long getId(){         return this.id;     }     public String getName(){         return this.name;     }...
Image
  JDBC 4: (WHERE CLAUSE, INSERTING, RETREIVING)    public class User {     private Long id;     private String name;     private String mobileNumber;     private String username;     private String password;     public User(){}     public User(Long id,String name, String mobileNumber, String username, String password){         this.id=id;         this.name=name;         this.mobileNumber=mobileNumber;         this.username=username;         this.password=password;     }     public User(Long id) {         this.id=id;     }     public Long getId()     {         return this.id;     }     public String getName(){         return this.name;     }     public String...
Image
  JDBC 3: (inserting) public class User{     private Long id;     private String name;     private String contactDetail;     private String username;     private String password;          public User(){}          public User(String name,String contactDetail,String username,String password){         this.name = name;         this.contactDetail = contactDetail;         this.username = username;         this.password = password;     }          public User(Long id,String name,String contactDetail,String username,String password){         this.id =id;         this.name = name;         this.contactDetail = contactDetail;         this.username = username;         this.password = ...
Image
  JDBC 2: public class User { //your code goes here...     private Long id;     private String name;     private String contactDetail;     private String username;     private String password;          public User(){}     public User(Long id,String name,String contactDetail,String username,String password){         this.id = id;         this.name  = name;         this.contactDetail = contactDetail;         this.username = username;         this.password = password;     }          public Long getId(){         return id;     }     public void setId(Long id){         this.id = id;     }     public String getName(){         return name;     }   ...
Image
  JDBC 1: _____________________________________________________________________ public class ItemType{          Long id;     String name;     Double deposit;     Double costPerDay;          ItemType(){ }     ItemType(Long id, String name, Double deposit, Double costPerDay){         this.id = id; this.name = name; this.deposit = deposit; this.costPerDay = costPerDay;         }          public String getName() {     return name;     }     public void setName(String name) {     this.name = name;     }               public Double getDeposit() {     return deposit;     }     public void setDeposit(Double deposit) {     this.deposit = deposit;     }    ...