Quick Question: db access through thread?
Posted: Tue Nov 18, 2014 1:23 pm
Quick question: If i have a function that accesses database (like the one below) can i use it right away or should i put it in a thread?:
If it is not put in a thread what gets blocked? The script for the user that accesses it, the script for all the ppl that accesses it, whole server, nothing? :p
Code: Select all
void functionForDb(){ try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { .. } catch (SQLException e) { }}