Way back in 2017, in the time before time…I talked about a new type III JDBC driver that used Oracle REST Data Services in a mid-tier to connect to a REST enabled Oracle Database.

SQLcl supports this JDBC driver.

All you need are –

  • the driver (jar)
  • ORDS running for your database(s)
  • a REST enabled schema
  • the REST Enabled SQL service enabled

In Autonomous you already have those requirements taken care of. ALL you need is to grab the driver, which you can get here.

With that JAR downloaded, copy it to your SQLcl/lib directory.

Just paste it in there, no need to even restart your SQLcl instance if you already have it running.

And you’re ready to connect!

Autonomous Example (admin)

All of your Oracle Autonomous Database cloud services (Data Warehouse, Transaction Processing, JSON, …) will have an ADMIN user. It will be REST enabled out-of-the-box so you can login with SQL Developer Web.

Using your ADMIN database user password, you can now login.

The JDBC URL is user/password@jdbc:oracle:orest:@https://ORDSHost…/ords/USER/

My Always Free Transaction Processing Service base URL is the same I would use to login to SQL Developer Web or access a RESTful Web Service.

What’s Different?

Quite a bit. We’re no longer going to be in a transaction world where I can roll things back, or even COMMIT when I want to. We’re in the HTTPS/REST world – so think, AUTOCOMMIT.

Every request or command we make – is going to be its own transaction, even running in its own database connection. So if you’re going to use this for benchmarking, it will probably be slower than using the regular JDBC driver.

Since we’re using the Autonomous managed ORDS to connect, we’re on the ‘low’ service by default

You don’t have to use ADMIN

Remember, you can use ANY REST enabled schema. And you can manage these accounts using SQL Developer Web.

REST Enabled schemas can be used to login to SQLDev Web & publish RESTful Web Services.

You don’t have to use SQLcl, either

It’s a JDBC driver. SQLcl is just our vendor provided utility that happens to support it. Theoretically you could use this in any of your Java applications wanting to connect to an Oracle Database!

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

2 Comments

  1. Jeff,

    Awesome article.

    Note that with SQLcl 22.4 and the latest JDBC driver, it appears that the JDBC URL has become much easier: user/password@https://ORDSHost…/ords/USER/ instead of user/password@jdbc:oracle:orest:@https://ORDSHost…/ords/USER/

    Anton and I lost a bit of time today trying to get this to work… Right up until I asked him: Did you read this ReadMe on the download page?

    😉

    Thanks for all you do here, we all really appreciate it!

Write A Comment