package com.example.schedulerapp; import java.sql.*; public class Schedule { private Connection dbConnection; protected Schedule() { connectDataBase(); } 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."; } }