exadataexpress-logo

Using Java Developer Tools with Oracle Database Exadata Express Cloud Service (EECS)UCP

Access the Oracle Database Exadata Express Cloud Service using Java Developer tools such as JDeveloper, NetBeans, Eclipse, and Intellij. This page describes changing the path of JDK, passing location of tnsnames.ora, and passing location and password for JKS Files as system properties in each one of these development tools. Refer to this page for steps to establish a successful connection when using JDeveloper, NetBeans, Eclipse, and Intellij.

  1. Pre-requisites
    1. Download and install the latest JDK8 (version JDK8u71 or higher) or JDK 7 (JDK7u80 or higher).
    2. Download and Install JCE Policy files as described in Step #1 "Download and Install JDBC Thin Driver and UCP"
    3. Download the 12.2.0.1 JDBC Thin driver (ojdbc8.jar) and 12.2.0.1 ucp.jar OR Download the patched 12.1.0.2 JDBC Thin driver (ojdbc7.jar) and 12.1.0.2 UCP (ucp.jar) to a location and add the location classpath.
    4. Download security and network configuration files as described in Step#2 "Enable Oracle Network Connectivity and Download JKS files"
    5. Required system properties for the connection:
    6. [Linux]

      
      
          -Doracle.net.tns_admin=/home/myuser/cloud 
          -Doracle.net.ssl_server_dn_match=true 
          -Doracle.net.ssl_version=1.2 (Only for 12.1.0.2 JDBC driver)  
          -Djavax.net.ssl.trustStore=/home/myuser/cloud/truststore.jks  
          -Djavax.net.ssl.trustStorePassword=welcome1 
          -Djavax.net.ssl.keyStore=/home/myuser/cloud/keystore.jks
          -Djavax.net.ssl.keyStorePassword=welcome1  
          -Doracle.net.ssl_cipher_suites=(TLS_RSA_WITH_AES_256_CBC_SHA256)(Only for JDK7) 
          

      [Windows]

      
      
          -Doracle.net.tns_admin=c:\home\myuser\cloud 
          -Doracle.net.ssl_server_dn_match=true 
          -Doracle.net.ssl_version=1.2 (Only for 12.1.0.2 JDBC driver) 
          -Djavax.net.ssl.trustStore=C:\home\myuser\cloud\truststore.jks 
          -Djavax.net.ssl.trustStorePassword=welcome1 
          -Djavax.net.ssl.keyStore=C:\home\myuser\cloud\keystore.jks 
          -Djavax.net.ssl.keyStorePassword=welcome1
          -Doracle.net.ssl_cipher_suites=(TLS_RSA_WITH_AES_256_CBC_SHA256) (Only for JDK7)
          
  2. Oracle JDeveloper Java Edition 12.2.1.1
    1. Change the path of JDK to the one which is the latest and has the required JCE files.
      1. [Linux] Find the product.conf file. It should be located at $HOME/.jdeveloper/12.2.1.1.0
        Edit product.conf and update the following with the required JDK path.
        SetJavaHome /usr/jdk_1.8.0_91
      2. [Windows] Find the product.conf file. It should be located at %USERPROFILE%\AppData\Roaming\JDeveloper\<product-version>\ Edit product.conf and update the following with the required JDK path. SetJavaHome D:\java\jdk1.8.0_91
    2. Create a Database Connection and Test the connectivity
      1. Create a Database Connection File --> New --> Application --> Choose "Database Tier"--> Database Connection and follow all the steps to create a "Database Connection"
      2. Enter the DB details and Test the connection (a) Check "Enter Custom JDBC URL" and add the connection URL.  Append the contents of tnsnames.ora to the connection URL.  tnsnames.ora is part of the network configuration files downloaded from the service console. (b) click on "JDBC parameters" and add the required connection properties. (c) click on "Test Connection" and make sure that the connection is established.
      1. Create and Run a new Java Application
        1. Create a new Java project and Create a new Java class Check out  UCPSample.java. Update the code to use the Oracle Database Exadata Express Cloud specific  connection URL, Username, and Password.  Add a few SQL statements to test the connection.
        2. Compile the new Java Class Application --> Project Properties --> Add JAR/Directory --> Choose the patched 12.1.0.2 JDBC Thin driver (ojdbc7.jar) and ucp.jar.
          Check the JAVA SE Version and Make sure it is pointing to the correct JDK.
        3. Pass JKS files path and password as VM arguments
          
          
          Run --> Choose Active Run Configuration --> Manage Run Configurations Click on "Choose Custom Settings" --> Customize Settings 
          Run Configurations --> Click on 'Add' button --> Create a Run configuration --> Choose a name for the configuration 
          Run Configurations --> Click on 'Edit' button --> Java Options --> Pass all the 
          system properties
        4. Run your application
  3. NetBeans IDE 8.2
    1. Change the path of JDK to the latest and has the required JCE files.
      1. [Unix] Find the netbeans.conf file. It should be located at /etc/netbeans.conf
      2. [Unix] Edit netbeans.conf and update the following with the required JDK path. netbeans_jdkhome="/usr/jdk_1.8.0_91"
    2. Create and Run a new Java Application
      1. Create a new Java class within a new Java application. Check out  UCPSample.java. Update the code to use the Oracle Database Exadata Express Cloud specific  connection URL, Username, and Password.  Add a few SQL statements to test the connection.
      2. Compile the new Java Class Libraries --> Add JAR/Folder --> Choose the patched 12.1.0.2 JDBC Thin driver (ojdbc7.jar) and ucp.jar. Libraries --> Properties --> Check the Java Platform and Make sure it is pointing to the correct JDK.
      3. Set JKS files path and password as VM arguments Run --> Set Project Configuration --> Customize --> VM Options --> Pass the required properties  
      4. Run your application
  4. Eclipse Neon
    1. Change the path of JDK to the latest and has the required JCE files.
      1.  Open window --> Preferences --> Installed JREs --> Add.  Add a JDK home that is latest and also has the required JCE files. 
    2. Create and Run a new Java Application
      1. Create a new Java project and Create a new Java class Check out  UCPSample.java. Update the code to use the Oracle Database Exadata Express Cloud specific  connection URL, Username, and Password.  Add a few SQL statements to test the connection.
      2. Compile the new Java Class Right click on Project --> Properties --> Libraries --> Choose the patched 12.1.0.2 JDBC Thin driver (ojdbc7.jar) and ucp.jar.
      3. Set JKS files path and password as VM arguments Run --> Run Configurations --> Main --> Check if the UCPSample.java is the Main class. Go to 'Arguments' tab --> VM arguments --> Pass the required properties
      4. Run your application
  5. IntelliJ IDEA Community Edition 2016.2.4
    1. Change the path of JDK to the latest and also has the required JCE files.
      1.  When you create a new project, choose a JDK home that is latest and also has the required JCE files.
    1. Create and Run a new Java Application
      1. Create a new Java project and Create a new Java class Check out   UCPSample.java. Update the code to use the Oracle Database Exadata Express Cloud specific  connection URL, Username, and Password.  Add a few SQL statements to test the connection.
      2. Compile the new Java Class External Libraries --> Select JDK 1.8 --> Open Library Settings --> Global Libraries (under Platform Settings) --> Click on + --> Choose the patched 12.1.0.2 JDBC Thin driver (ojdbc7.jar) and ucp.jar.
      3. Set JKS files path and password as VM arguments Run --> Run Configurations --> Configuration --> Check if the UCPSample.java is the Main class. Under 'VM Options' --> Pass the required properties
      4. Run your application