public static String[] getPlayers() throws ClassNotFoundException, SQLException {
        String query = "Select Playername from player";
        Connection con = DBConnection.getConnectionToDB();
        ResultSet rst =  DBHandler.getData(con, query);
        int count = 0;
        while(rst.next()){
            count++;
        }
        rst.beforeFirst();
        String[] names =new String[count];
        
        for (int i = 0; rst.next(); i++){
            names[i]= rst.getString("PlayerName");
        }
        
        return names;
    }