Problem with JDBC Pool

My company is considering Percona cluster in order to improve our service.
We’re running some tests with the drive-mode loadbalance with JDBC connection pool.

We have the following problem:
When stopping a node, the node connections in the pool return error.

Is there a way to prevent these connections may return error and maybe connections to migrate to another node in a transparent manner for the clinet.

We use this connection string:

Thanks in advance.