Dave Tolls wrote:You could cut down the number of db accesses there.
Just get the PlayerUID for the given AreaID.
If it matches then exit, if not then do the Friends query.
That middle SELECT is a bit unnecessary.
Indeed, you might be able to come up with a single query, but not knowing the logic I can't say.
In addition I would recommend reading up on PreparedStatements.
Seeing concatenated queries like that makes me itchy.
Oh yes, and your ResultSet should be closed off in a finally block (or use a try-with-resources).
At the moment, if you get an exception inside there you may end up leaking resources as the ResultSet(s) won't be closed.
Dave Tolls wrote:Sorry, it's me being a bit dim.
The deserialisation skips normal object creation, so that instantiation of the List doesn't happen.