-
Rafi authored
Fixed bugs with that caused in consistencies with message sending between client and server. All employee data should be updated to all clients when employee data is modified in the database. The client should have an updated copy of employee information.
Rafi authoredFixed bugs with that caused in consistencies with message sending between client and server. All employee data should be updated to all clients when employee data is modified in the database. The client should have an updated copy of employee information.
Model.java 953 B
package com.example.schedulerapp;
import java.sql.*;
public class Model {
protected Staff staff;
protected Schedule schedule;
private Connection dbConnection;
public Model(){
connectDataBase();
this.staff = new Staff(dbConnection);
this.schedule = new Schedule(dbConnection);
}
protected String connectDataBase(){
try {
dbConnection = DriverManager.getConnection("jdbc:mysql://localhost:3306/ScheduleApp", "root", "password");
} catch (Exception e) {
System.out.println(e.fillInStackTrace());
return "Couldn't connect to database.";
}
return "Successfully connected to database.";
}
public static void main(String[] args) {
Model model = new Model();
/* Testing stuff that should be cleaned up for the alpha
String s = model.staff.getEmployees();
System.out.println();
*/
}
}