title: Connecting to Oracle DB via python
body: <p>I'm using <code>jaydebeapi</code> to connect to an oracle DB. The code is as follows:</p>
  
  <pre><code>host = [address]
  port = "1521"
  sid = "ctginst1"
  database = "oracle"
  drivertype = "thin"
  uid = [user]
  pwd = [pass]
  
  driver_class = "oracle.jdbc.OracleDriver"
  
  driver_file = "ojdbc10.jar"
  
  connection_string="jdbc:{}:{}@{}:{}:{}".format(database, drivertype, host, port, sid)
  
  conn=jaydebeapi.connect(driver_class, connection_string, [uid, pwd], driver_file, )
  </code></pre>
  
  <p>However this fails and gives me an error:</p>
  
  <p><code>java.lang.RuntimeException: Class oracle.jdbc.OracleDriver not found</code></p>
  
  <p>Edit:
  By passing CLASSPATH with the .jar's location when starting JVM and only then attempting the connection I managed to proceed further with</p>
  
  <pre><code>import jpype
  jpype.startJVM(jpype.getDefaultJVMPath(), '-Djava.class.path=%s' % driver_file)
  </code></pre>
  
  <p>And now I am getting <code>java.sql.SQLException: Invalid Oracle URL specified</code> error</p>