Advertisement
elsemTim

Department

Nov 15th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. /**
  2.  * Created by elsemTim on 15.11.2016.
  3.  */
  4.  
  5. import java.text.DateFormat;
  6. import java.sql.ResultSet;
  7. import java.sql.SQLException;
  8. import java.text.Collator;
  9. import java.util.Date;
  10. import java.util.Locale;
  11.  
  12. public class Department {
  13.     private int ID;
  14.     private String nameDepartment;
  15.     private String mail;
  16.     private String phone;
  17.  
  18.     public Department (ResultSet rs) throws SQLException{
  19.         SetID(rs.getInt(0));
  20.         SetNameDepartment(rs.getString(1));
  21.         SetMail(rs.getString(2));
  22.         SetPhone(rs.getString(3));
  23.     }
  24.  
  25.     //set
  26.     public void SetID( int ID ){
  27.         this.ID=ID;
  28.     }
  29.  
  30.     public void SetNameDepartment( String nameDepartment){
  31.         this.nameDepartment=nameDepartment;
  32.     }
  33.  
  34.     public void SetMail( String mail ){
  35.         this.mail=mail;
  36.     }
  37.  
  38.     public void SetPhone( String phone ){
  39.         this.phone=phone;
  40.     }
  41.  
  42.     //get
  43.     public int GetID(){
  44.         return ID;
  45.     }
  46.  
  47.     public String GetNameDepartment(){
  48.         return nameDepartment;
  49.     }
  50.  
  51.     public String GetMail(){
  52.         return mail;
  53.     }
  54.  
  55.     public String GetPhone(){
  56.         return phone;
  57.     }
  58.  
  59.  
  60.  
  61.     //Метод возвращает все данные в виде строки
  62.     //public String toString()
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement