How to test connection to Oracle database without installing Oracle client

To test connection from Linux server to Oracle database without installing Oracle client & sqlplus. All you need is java jdk installed and a small jar file as follow steps.

The Oracle JDBC Tester ( https://github.com/aimtiaz11/oracle-jdbc-tester ) is a handy tool we’ll use to test JDBC connection from our server to Oracle database.

First download the jar file and add execute permission to it:

wget https://github.com/aimtiaz11/oracle-jdbc-tester/releases/download/v1.0/jdbc-tester-1.0.jar
chmod +x jdbc-tester-1.0.jar

Execute this command with syntax as follow:

java -jar ./jdbc-tester-1.0.jar SCHEMANAME PASSWORD jdbc:oracle:thin:@ORACLE_IP:ORACLE_PORT/ORACLE_SERVICENAME

For example:

java -jar ./jdbc-tester-1.0.jar USERNAME password123 jdbc:oracle:thin:@172.16.1.55:1521/DBORCL

Then the successfull result like this:

18:54:28.083 [main] INFO Main - arg 0 = USERNAME
18:54:28.086 [main] INFO Main - arg 1 = password123
18:54:28.086 [main] INFO Main - arg 2 = jdbc:oracle:thin:@172.16.1.55:1521/DBORCL
18:54:28.164 [main] INFO Main -  Starting JDBC Connection test *
18:54:28.455 [main] INFO Main - Running SQL query: [select sysdate from dual]
18:54:28.469 [main] INFO Main - Result of sql Query: [2019-06-07 18:19:51.0]
18:54:28.469 [main] INFO Main - JDBC connection test successful!

In case of wrong username/password, the result will like this:

18:56:01.334 [main] INFO Main - arg 0 = USERNAME
18:56:01.337 [main] INFO Main - arg 1 = password1
18:56:01.337 [main] INFO Main - arg 2 = jdbc:oracle:thin:@172.16.1.55:1521/DBORCL
18:56:01.425 [main] INFO Main -  Starting JDBC Connection test *
18:56:01.646 [main] ERROR Main - Exception occurred connecting to database: ORA-01017: invalid username/password; logon denied

Related:  Installation of doxygen and error in make command

Leave a Reply

Your email address will not be published. Required fields are marked *