Package src.util
Class database
java.lang.Object
src.util.database
Database-Class used to write and read Data from the Database
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleancheckAvailable(String username, String email) Check if the username and email are availablestatic booleancreateAppointment(user user, appointment appointment) Create an Appointmentstatic usercreateUser(user user) Create Userstatic booleandeleteAppointment(appointment appointment) Delete an Appointmentstatic booleandeleteUser(user user) Delete Userstatic ArrayList<appointment>getAppointments(user user) Get all Appointments of Userstatic ArrayList<appointment>Get all Appointments that hasn't got an reminder email.Get all symptomsstatic userGet userstatic usergetUserofAppointment(int AppointmentID) Get User of AppointmentGet all users (to display them on the Admin Tab)static userLogin Method - Check if the user exist and if the password is correctstatic booleanreminderSend(appointment appointment) Save in the Database that the Remindermail of an Appointment was sentstatic booleanshiftAppointment(appointment appointment) Shift an Appointmentstatic booleanupdateUser(user user) Update User
- 
Constructor Details- 
databasepublic database()
 
- 
- 
Method Details- 
createAppointmentCreate an Appointment- Parameters:
- user- the patient of the appointment
- appointment- the appointment object
- Returns:
- true if the appointment was successfully created, otherwise false
 
- 
shiftAppointmentShift an Appointment- Parameters:
- appointment- the appointment object
- Returns:
- true if the appointment was successfully shifted, otherwise false
 
- 
deleteAppointmentDelete an Appointment- Parameters:
- appointment- the appointment object
- Returns:
- true if the appointment was successfully deleted, otherwise false
 
- 
getAppointmentsGet all Appointments of User- Parameters:
- user- the user
- Returns:
- ArrayList of Appointments of the user
 
- 
getReminderNotSendAppointmentsGet all Appointments that hasn't got an reminder email.- Returns:
- ArrayList of Appointments that hasn't got an reminder mail
 
- 
reminderSendSave 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
 
- 
getUsersAsStringGet all users (to display them on the Admin Tab)- Returns:
- arraylist of all users
 
- 
getUserGet user- Parameters:
- username-
- Returns:
- user object or null if user dosent exist
 
- 
getUserofAppointmentGet User of Appointment- Parameters:
- AppointmentID-
- Returns:
- the user of the appointment
 
- 
createUserCreate User- Parameters:
- user- the new user
- Returns:
- the new user with the updated id
 
- 
updateUserUpdate User- Parameters:
- user- the updated user object
- Returns:
- true if the user was updated, otherwise false
 
- 
loginLogin 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
 
- 
checkAvailableCheck if the username and email are available- Parameters:
- username-
- email-
- Returns:
- true if the username and email are available, otherwise false
 
- 
deleteUserDelete User- Parameters:
- user- the user to delete
- Returns:
- true if the user was deleted, otherwise false
 
- 
getSymptomsGet all symptoms- Returns:
- arraylist of all symptoms
 
 
-