Execute across threads
The same Statement or ResultSet instance cannot be accessed concurrently across threads. You can, however, share a Connection object between multiple threads.
For example, if one thread executes the Statement.executeQuery() method on a Statement object, and another thread executes the Statement.executeUpdate() method on the same Statement object, the results of both methods are unexpected and depend on which method was executed last.
Similarly, if one thread executes the method ResultSet.next() and another thread executes the same method on the same ResultSet object, the results of both methods are unexpected and depend on which method was executed last.