DBConnect Class: Variables and Methods

I need help in figuring out what should I do to stop the error tag on Apache. It suggests removing the unused “connectToDB”:
private static Connection connectToDB(String database) throws ClassNotFoundException
SQLException{
Class.forName(“com.mysql.cj.jdbc.Driver”);
Connection dbConnect = DriverManager.getConnection(jdbc_url, username, password);
System.out.println(“Connected to the " + database + " database”);
return dbConnect;
}