Oracle JDBC + Maven - how (not) to do it
Warning
This post is somewhat of a rant - if you are affiliated with Oracle corp, you might want to avoid reading the rest.The goal
I wanted to write a simple Java application that demonstrated property based testing for a PL/SQL function in an Oracle database.The facts, and some assumptions
Oracle database is owned by Oracle corp.Java is owned by Oracle corp.
Maven is the de-facto standard for building Java applications.
Therefore, one might assume that using Maven to build a Java application that connects to an Oracle database is pretty straightforward - just include the relevant dependency in your POM. After all, it's just a JDBC client, right?
RIGHT?
Nope.
Welcome to the wonderful world of Oracle, where lawyers, usage restrictions and stupid license agreements are king and developers are ... not really welcome.
You either have to
- download the jar file from Oracle's website (and acknowledge that you're legally entitled to download it), register with Oracle and say yes to their proprietary license agreement
- install the jar file locally with maven
or
- use the Oracle maven repository (which - again - requires you to register with Oracle and acknowledge their proprietary license agreement)
- store your username + encrypted password in a settings file