Testing Oracle jdbc connection with jdbc-tester.jar.
search cancel

Testing Oracle jdbc connection with jdbc-tester.jar.

book

Article ID: 221075

calendar_today

Updated On:

Products

CA Automic One Automation

Issue/Introduction

How to test the Oracle jdbc connection? 

Environment

Release : 12.2., 12.3

Component : AUTOMATION ENGINE

Cause

Configuration.

Resolution

The jdbc-tester-1.1.jar can be used for a quick Oracle jdbc connect string test.

Syntax:

java -jar target/jdbc-tester-1.0.jar <schema_name> <schema_password> jdbc:oracle:thin:@//<host>:<port>/<SID>

The most current version can be downloaded here: https://github.com/aimtiaz11/oracle-jdbc-tester

Additional Information

Example for a successful test result:

[support@lvntest021348 bin]$ java -jar jdbc-tester-1.1.jar Automic password jdbc:oracle:thin:@//<dnsname>:1521/orclpdb
21:45:36.207 [main] INFO Main - arg 0 = Automic
21:45:36.218 [main] INFO Main - arg 1 = password
21:45:36.218 [main] INFO Main - arg 2 = jdbc:oracle:thin:@//<dnsname>:1521/orclpdb
21:45:36.868 [main] INFO Main - ****** Starting JDBC Connection test *******
21:45:37.381 [main] INFO Main - Running SQL query: [select sysdate from dual]
21:45:37.409 [main] INFO Main - Result of SQL query: [2021-08-04 21:45:37.0]
21:45:37.411 [main] INFO Main - JDBC connection test successful!

Test result for wrong Oracle port:

[support@lvntest021348 bin]$ java -jar jdbc-tester-1.1.jar Automic Automic1 jdbc:oracle:thin:@//<dnsname>:1544/orclpdb
21:45:43.825 [main] INFO Main - arg 0 = Automic
21:45:43.831 [main] INFO Main - arg 1 = password
21:45:43.831 [main] INFO Main - arg 2 = jdbc:oracle:thin:@//<dnsname>:1544/orclpdb
21:45:44.015 [main] INFO Main - ****** Starting JDBC Connection test *******
21:45:44.129 [main] ERROR Main - Exception occurred connecting to database: IO Error: The Network Adapter could not establish the connection

Test result for wrong database name:

[support@lvntest021348 bin]$ java -jar jdbc-tester-1.1.jar Automic password jdbc:oracle:thin:@//<dnsname>:1521/orclpdber
22:00:32.001 [main] INFO Main - arg 0 = Automic
22:00:32.007 [main] INFO Main - arg 1 = password
22:00:32.008 [main] INFO Main - arg 2 = jdbc:oracle:thin:@//<dnsname>:1521/orclpdber
22:00:32.221 [main] INFO Main - ****** Starting JDBC Connection test *******
22:00:32.388 [main] ERROR Main - Exception occurred connecting to database: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

Test result for wrong host:

[support@lvntest021348 bin]$ java -jar jdbc-tester-1.1.jar Automic password jdbc:oracle:thin:@//<dnsname>:1544/orclpdb
23:28:05.993 [main] INFO Main - arg 0 = Automic
23:28:06.001 [main] INFO Main - arg 1 = password
23:28:06.001 [main] INFO Main - arg 2 = jdbc:oracle:thin:@//<dnsname>:1544/orclpdb
23:28:06.223 [main] INFO Main - ****** Starting JDBC Connection test *******
23:28:06.519 [main] ERROR Main - Exception occurred connecting to database: IO Error: Unknown host specified

Attachments

jdbc-tester-1.1_1628119318800.jar get_app