I\'m running a web application on Tomcat. I have a class that handles all DB queries.
This class contains the Connection
object and methods that returns query r
If you are only running Select
queries (searchUser
sounds like only selecting data) there will be no issues, apart from thread contention.
As far as I know, a Connection
can only handle one query at a time, so by using a single instance you will essentially serialize database access. But this does not necessarily mean, it is always safe to access a database like this in a multi threaded environment. There might still be issues if concurrent accesses are interleaving.