I would like to create a query that will read the username and passwords and also the user groups of around 200 people; in a static method, so that I will not be required to make a connection to the database for each coming login/password check. But still stays a problem, during the time the database might change, maybe a user is canceled etc. I want my results also to be synchronized with the database. What is the way to achieve such a goal? any idea? does jdbc supply such an API?
It would probably make more sense to leave your user data in the database so you don't have to worry about synchronization problems and use a connection pool to mitigate your connection creation expenses. Do a search on this forum for "connection pool". There's a couple topics a day.