LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub
Star

Oracle

In the previous steps, we have tried the single query, multiple queries, and updates to the MySql database. In this step, we are going to switch from MySql database to Oracle in the configuration service.yml and update pom.xml to include Oracle DB driver as part of the dependency.

The first step is to start the Oracle database in Docker. The command has shown above.

Next, we need to manually install Oracle JDBC driver jar into your local maven repository. You can search on the Internet on the instructions. If you are not interested in Oracle, please skip this step. The only reason I have Oracle in this tutorial is that one of our customers only have Oracle database as the approved solution. Downloading Oracle XE Docker image will take a long time, and that image is not stable and can be broken at any time.

To switch to the Oracle database, you need to replace service.yml from dbscript/oracle/config folder. First, let’s create a new folder from updates and copy the service.yml

cd ~/networknt/light-example-4j/rest/openapi/database
cp -r updates oracle
cp dbscript/oracle/config/service.yml oracle/src/main/resources/config

Second, we need to update pom.xml to include the Oracle DB driver. Since Oracle DB driver is not available in maven central, you need to manually download it from oracle.com and manually install it in your local .m2 repository.

The reason we have include Oracle here is since one of our customers can only use this database as the corporate policy. If you are part of these type of organizations, then you know how to install the Oracle driver. Otherwise, it is highly recommended to use other open source relational databases like MySql or Postgres. If you are building microservices with separate database instances per service and you have thousands of services, Oracle license cost will be too high to afford even big banks.

Here is a line that needs to be added into pom.xml section

        <version.oracle>11.2.0.3</version.oracle>

Here are several lines to be added into the dependencies section.

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>${version.oracle}</version>
        </dependency>

Now let’s build the server from the oracle folder.

cd oracle
mvn clean install exec:exec

Now you can test the server with curl to verify that the server is working with Oracle database.

curl -k https://localhost:8443/v1/query

In the next step, we are going to switch the MySQL database to Postgres.

  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“Oracle” was last updated: July 5, 2021: fixes #275 checked and corrected grammar/spelling for majority of pages (#276) (b3bbb7b)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute