You can create several connections with multiple users
but each such connection should be created within a separate thread.
JDBC does not support multiple users using more than one connection simultaneously.
You cannot use multiple connection instances unless creating a connection pool.
It is possible to work with several database users but not at the same time.
Before connecting as different user all previous connections should be closed.
Use several Connection objects with different database users.
You should instantiate appropriate number of Driver object instances.
|