title: to establish database connection using UNIX shell script
body: <p>I am new to shell scripting and have less or no idea on this.
  I have to read a db.properties file which has the database connection details i.e. to which db to connect. Then i have to establish a connection to that database and perform an operation to check the current time.</p>
  
  <p>Below is my db.properties file :-</p>
  
  <pre><code>driverClassName=oracle.jdbc.driver.OracleDriver
  url=jdbc:oracle:thin:@171.01.187.94:1532:DEV
  userName=abc
  password=abc
  </code></pre>
  
  <p>Below is my script to call the db.properties file :-</p>
  
  <pre><code>#!/bin/bash
  
  file="./database.properties"
  
  if [ -f "$file" ]
  then
      echo "$file found."
   . $file
  
    echo "User Id       = " ${userName}
    echo "user password = " ${password}
    echo "url  = " ${url}
  
    sqlplus -S ${userName}/${password}@${url}
  
  else
      echo "$file not found."
  fi
  </code></pre>
  
  <p>But i am getting the below error :-</p>
  
  <p>ERROR:
  ORA-12154: TNS:could not resolve the connect identifier specified</p>
  
  <p>Could anyone please help on the above issue ?</p>