You can connect to external database by writing DB connection details in prconfig.xml, however you need to check for the option as 'use with preferences' in Database rule instead of JDBC URL. If you are trying to connect through JDBC url using database rule then you have to import the driver.jar file (you can use import wizard) and restart the server. Additional configurations in prconfig.xml are not required if you are connecting via JDBC url.
The test connection may work if you first look up the driver class in System Management Application under Advance>Web Tier Runtime Environment>Java Class Name. If this is the case, the DB connection will work fine during runtime, only the test connection is affected.