Hi Pavel,
thank you for your really informative answer. Sadly, asking users to remember password is not a feasible option: they are machinists in a manufacturing company and could punch me on the face if I ask so - literally, not joking. Anyway, the application is used only in our private network, the mySQL user has almost no rights on the DB and the password is known by almost anyone in the factory, so this is more an exercise for my programming skills than a real need. Maybe an option could be using the single sign on from the operating system.
Regards,
Giorgio