Code Monkey home page Code Monkey logo

eap-oracle-db's Introduction

eap-oracle-db

Example of using an Oracle JDBC datasource with the Red Hat JBoss EAP 7.1.x container for Openshift.

This example adds an Oracle JDBC driver as a module into the JBoss EAP image during an Openshift based source to image (s2i) build. A datasource is created at deploy time that uses the Oracle JDBC driver. This example assumes that the Oracle database is visible to pods via DNS alone.

NOTE: The Oracle JDBC driver is not provided with this example. Download the JDBC driver.

This repository provides a working reference which includes:

  • An .s2i directory that includes an environment file that sets CUSTOM_INSTALL_DIRECTORIES=extensions. This is used by scripts provided in the JBoss EAP image to allow for customization to take place at pod deploy time.
  • An extensions directory that contains
    • The necessary module directory structure and module.xml file for the Oracle JDBC driver, as well as the Oracle JDBC driver file. The Oracle JDBC driver must be downloaded from Oracle.
    • A drivers.env file that contains driver specific details. This example includes one driver, but multiple drivers can be included. Refer to the JBoss EAP for Openshift documentation for further details about the expected contents of this file.
    • An install.sh file that is executed during the Openshift s2i build process. This script takes care of installing the Oracle JDBC driver as a module into the JBoss EAP image (adding files to the image and updating the standalone-openshift.xml to include the driver config).
  • A configuration directory that contains
    • A datasources.env file that provides all the specifics for the datasource. These settings are incorporated into the JBoss EAP configuration at pod deploy time. Multiple datasources can be provided, although this example uses only one. Refer to the JBoss EAP for Openshift documentation for further details about the expected contents of this file.
  • The environment variable ENV_FILES should be set in the deploymentconfig for this pod. The variable is set to the location/path of the .env file for the datasources. For this example, the variable would be set like so: ENV_FILES=/opt/eap/standalone/configuration/*.env
    • Example oc command to set this envrionment variable: oc set env dc/the-deploymentconfig-name ENV_FILES=/opt/eap/standalone/configuration/*.env

How it works

An Openshift build process clones this git repo into a build pod that performs a maven build of the example servlet. The example servlet artifact and Oracle JDBC driver are copied into the image during the build. The JBoss EAP configuration file (/opt/eap/standalone/configuration/standalone-openshift.xml) that is provided in the JBoss EAP for Openshift image is updated to include the Oracle JDBC driver configuration. The Openshift build process produces a container image to be used directly in application pods or as a base image for application pods to derive from.

When the resulting container image is used to produce an application pod, the pod is configured at deploy time to include datasource settings provided by the datasources.env file.

Example container creation

  1. Clone this repository to a local workspace.
git clone https://github.com/travisrogers05/eap-oracle-db
  1. Download and install the Oracle JDBC driver.. Install the JDBC driver JAR file under the extensions/modules/com/oracle/main directory. Modify the JAR file name in the extensions/modules/com/oracle/main/module.xml, if needed.

  2. Create a new Openshift project (replace project-name with a name you choose)

oc new-project <project-name>
  1. Create an application pod in the project, adding the files and settings from this repository into a created container (replace app-name with a name you choose):
oc process openshift//eap71-basic-s2i APPLICATION_NAME=<app-name> SOURCE_REPOSITORY_URL=https://github.com/travisrogers05/eap-oracle-db SOURCE_REPOSITORY_REF=master CONTEXT_DIR="" | oc create -f -

eap-oracle-db's People

Contributors

druvsingh42 avatar travisrogers05 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.