Yaguo
it seems JDBC API hasn't listener to know when DB change the password. Some vendor provide API in their JDBC driver, like http://docs.oracle.com/cd/E14072_01/java.112/e10589/dbchgnf.htm.
Use them and try to evict old connection and get new connection by new password. Do you think it is an approach?