If you are using a catalog connection, datasource.xml, and at the same time, you have set new connection information via the Server API/URL ((jrs.jdbc_driver, jrs.jdbc_url, jrs.db_user, jrs.db_pswd), the priority of these three is as follows:
Server API > datasource.xml > catalog connection
This means that if the approach with higher priority fails to get the connection, the one with the next lower priority will be used.