Connecting to Oracle with JDBC.jl

Since there is currently no Julia driver for the Oracle database, we will show how to connect using the JDBC driver as follows:

  1. Execute the following commands to obtain a connection:
using DataFramesusing JDBCJDBC.usedriver("ojdbc8.jar")JDBC.init()
  1. The next step is to open the connection. Please note that in this example we use the AWS RDS Oracle database that was available online when writing this recipe. You will need to provide a different database hostname; also, for the  "type_password_here" string, use your actual password:
conn = JDBC.DriverManager.getConnection("jdbc:oracle:thin:@ora.cez1pkekt7fj.us-east-2.rds.amazonaws.com:1521:ORCL",Dict("user"=>"orauser","password"=>"type_password_here")); ...

Get Julia 1.0 Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.