title: cx_Oracle Connection Timeout
body: <p>I am trying to connect to Oracle database but getting below error:</p>
  
  <blockquote>
    <p>curcon = cx_Oracle.connect(conn_str)  cx_Oracle.DatabaseError:
    ORA-12170: TNS:Connect timeout occurred</p>
  </blockquote>
  
  <p>Here's block of code:</p>
  
  <pre><code>conn_str = u'user/pwd@111.22.33.444:8000/service'
  curcon = cx_Oracle.connect(conn_str) 
  cursor = curcon.cursor()
  </code></pre>
  
  <p>I tried solutions from these two threads but none of them works:</p>
  
  <p><a href="https://stackoverflow.com/questions/2374079/set-database-connection-timeout-in-python">Set database connection timeout in Python</a></p>
  
  <p><a href="https://stackoverflow.com/questions/23970158/ora-12170-tnsconnect-timeout-occurred">ORA-12170: TNS:Connect timeout occurred</a></p>