Login with different username on few devices parallelly

I’m trying to run login test on few devices parallelly.
Two devices cant use the same username.
later, I want to perform few db validation testing on each device.

for instance:
device id xxxxx login with username = 1
device id xxxxx login with username = 2
device id xxxxx login with username = 3

Then, in another test:
select * from xxx where username = 2

Any ideas on how to perform this?

I’m using java.