I am fairly certain the reconnection details, etc will be driver specific.
Many dbs will not drop the current connections when changing passwords - only used when a new connection is created.
The easiest solution is to set the max connection lifetime on the pool, and change the password there to match.
How you coordinate that will be more involved.
Might be easier to detect the invalid password error and reset the pool.
I have a long running daemon written in Go, that listens to a port and spins up multiple go routines for every new connection to handle the data. There is a global variable context that has db Conn(*sql.DB) that is assigned connection context returned by database/sql library’s open() function during initialization time.