Package src.util

Class database

java.lang.Object
src.util.database

public class database extends Object
Database-Class used to write and read Data from the Database
  • Constructor Details

    • database

      public database()
  • Method Details

    • createAppointment

      public static boolean createAppointment(user user, appointment appointment)
      Create an Appointment
      Parameters:
      user - the patient of the appointment
      appointment - the appointment object
      Returns:
      true if the appointment was successfully created, otherwise false
    • shiftAppointment

      public static boolean shiftAppointment(appointment appointment)
      Shift an Appointment
      Parameters:
      appointment - the appointment object
      Returns:
      true if the appointment was successfully shifted, otherwise false
    • deleteAppointment

      public static boolean deleteAppointment(appointment appointment)
      Delete an Appointment
      Parameters:
      appointment - the appointment object
      Returns:
      true if the appointment was successfully deleted, otherwise false
    • getAppointments

      public static ArrayList<appointment> getAppointments(user user)
      Get all Appointments of User
      Parameters:
      user - the user
      Returns:
      ArrayList of Appointments of the user
    • getReminderNotSendAppointments

      public static ArrayList<appointment> getReminderNotSendAppointments()
      Get all Appointments that hasn't got an reminder email.
      Returns:
      ArrayList of Appointments that hasn't got an reminder mail
    • reminderSend

      public static boolean reminderSend(appointment appointment)
      Save in the Database that the Remindermail of an Appointment was sent
      Parameters:
      appointment - the appointment for which the reminder-mail was sent
      Returns:
      true if the remindercheck changed in the database, otherwise false
    • getUsersAsString

      public static ArrayList<String> getUsersAsString()
      Get all users (to display them on the Admin Tab)
      Returns:
      arraylist of all users
    • getUser

      public static user getUser(String username)
      Get user
      Parameters:
      username -
      Returns:
      user object or null if user dosent exist
    • getUserofAppointment

      public static user getUserofAppointment(int AppointmentID)
      Get User of Appointment
      Parameters:
      AppointmentID -
      Returns:
      the user of the appointment
    • createUser

      public static user createUser(user user)
      Create User
      Parameters:
      user - the new user
      Returns:
      the new user with the updated id
    • updateUser

      public static boolean updateUser(user user)
      Update User
      Parameters:
      user - the updated user object
      Returns:
      true if the user was updated, otherwise false
    • login

      public static user login(String username, String passwordCheck)
      Login Method - Check if the user exist and if the password is correct
      Parameters:
      username -
      passwordCheck - the password
      Returns:
      user object and null if the username or password is wrong
    • checkAvailable

      public static boolean checkAvailable(String username, String email)
      Check if the username and email are available
      Parameters:
      username -
      email -
      Returns:
      true if the username and email are available, otherwise false
    • deleteUser

      public static boolean deleteUser(user user)
      Delete User
      Parameters:
      user - the user to delete
      Returns:
      true if the user was deleted, otherwise false
    • getSymptoms

      public static ArrayList<symptom> getSymptoms()
      Get all symptoms
      Returns:
      arraylist of all symptoms