0

I'm coding a desktop app in Java I want to be used by many users on a local network db. I have a login frame.

The problem is that everytime i want to write a query i have to get a new connection.

First question is: How can i get my connection method somehow to remember the login username and password the user wrote to login so it would connect right away?

Second question is: (possibly answered if the first one is answered) Can i have a user-stamp for every record inserted, updated?

My thoughts are whether or a desktop app with a local db is able to handle many users correctly.

JohnK
  • 21
  • 3

1 Answers1

1

For the first question: To acquire a connection every time is expensive. Try using a connection pool. Please refer to BalusC's answer on connection pooling here: https://stackoverflow.com/a/4209660/229634

For the second question: Is there a reason that prevents you from tracking user activities or updates? If not, then it is wise to do so. This can even save you a lot of trouble in the long run, if ever you encounter data issues or bugs due to an update/insert in the db.

Whether your db can handle the volume/performance depends entirely on the type of database you use. Typically most DB's should be able to unless you have an exceptional volume of users. MySQL should definitely be able to handle what you throw at it.

Joey Ezekiel
  • 1,017
  • 1
  • 11
  • 26