public static void main(String[] args) throws SQLException {

        File file = new File(HOSPITALOUT);
        
        conn = DriverManager.getConnection("jdbc:derby://localhost:1527/hospital", "sa", "sa");
        dao = new PatientDAOJdbc(conn);
        
        List<Patient> list = dao.findAll();
        
        Scanner keyboard = new Scanner(System.in);
        
        petla_glowna: while (true) {
            
            showMainMenu();

            int option = readKeyboard(keyboard);

            System.out.println("wybrano " + option);
            
            //list.add("ala ma kota");
            
            switch (option) {
                case 1:
                    Patient p = readPatientFromKeyboard(keyboard);
                    list.add(p);
                    dao.save(p);
                    break;
                case 2:
                    
                    for(int i = 0; i < list.size(); i++) {
                        Patient tmp = list.get(i);
                        System.out.println(tmp.getName() + " " + tmp.getLastName());
                    }
                    
                    break;
                case 3 :
                    System.out.println("auto save jest już włączony");;
                    break;
                case 0:
                    conn.close();
                    break petla_glowna;
                    
                default:
                    System.out.println("nieistniejąca opcja");
            }
            
        }

        System.out.println("Koniec.");

    }