Thanks for this info. We have something similar to this, but if the connection fails to the database it just errors with:
Cannot connect to DBstore ("jdbcracle:thin:@dlsun511:1721:dbms733",
"scott", "tiger");

We wanted a test to give a error like an ORA or TNS error number. Or something like tnsping or sqlplus. We wanted to do this test without loading Oracle Client. Is this the only solution?