Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Red Hat JBoss Data Virtualization on OpenShift: Part 2 - Service enable your data

 

December 7, 2016
Cojan van Ballegooijen
Related topics:
ContainersKubernetes
Related products:
Red Hat JBoss Enterprise Application PlatformRed Hat OpenShift Container Platform

Share:

    Welcome to the part 2 of Red Hat JBoss Data Virtualization (JDV) running on OpenShift.

    JDV is a lean, virtual data integration solution that unlocks trapped data and delivers it as easily consumable, unified, and actionable information. JDV makes data spread across physically diverse systems such as multiple databases, XML files, and Hadoop systems appear as a set of tables in a local database.

    When deployed on OpenShift, JDV enables:

    1. Service enabling your data
    2. Bringing data from outside to inside the PaaS
    3. Breaking up monolithic data sources virtually for a microservices architecture

    Together with the JDV for OpenShift image, we have made available OpenShift templates that allow you to test and bootstrap JDV.

    Introduction

    In part 1 we described how to get started with JDV running on OpenShift. During the build phase of the pod several artifacts were downloaded from the provided GitHub URL in the JDV OpenShift template. We deployed two virtual databases (VDBs) called country-ws (external web service-based datasource) and marketdata-file (file-based datasource).

    icon_rh_hardware_storage-a-stack-virtual_rgb_flatA VDB is a container for components that integrate data from multiple disparate data sources, allowing applications to access and query the data as if it is in a single database and, therefore, using a single uniform API.

    A VDB is composed of various data models and configuration information that describes which data sources are to be integrated and how. In particular, source models are used to represent the structure and characteristics of the physical data sources, and view models represent the structure and characteristics of the integrated data exposed to applications.

    This article will show the out-of-the-box user-experience to query the data from the JDV instance running inside the OpenShift pod through OData REST services. REST is commonly used by companies that have implemented service-oriented architectures. However, it does not provide unified calling semantics nor does it provide a data model, meaning that each company has needed to define its own. OData is a solution to this problem because it provides a specification that defines standard ways to define data source operations and also standardizes the way in which you define your data schema.

    OData

    odatalogo-96The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. OData is used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites. OData is consistent with the way the Web works, it makes a deep commitment to URIs for resource identification and commits to an HTTP-based, uniform interface for interacting with those resources (just like the Web). This allows OData to enable a new level of data integration and interoperability across a broad range of clients, servers, services, and tools. JDV 6.3 supports OData v2 and v4.

    For more information on

    • OData v2 see http://www.odata.org/documentation/odata-version-2-0/
    • OData v4 see http://www.odata.org/documentation/

    Accessing data via OData

    JDV can expose any data source as an OData-based service out-of-the-box. During the deployment phase as explained in part 1 the following routes are created as depicted in the image below.

    screen-shot-2016-12-05-at-20-13-38

    An OpenShift route exposes a service as a host name, like datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io, so that external clients can reach it by name.

    OData-based services in JDV can be accessed either through http or https. When the pod including the JDV artifacts (i.e. VDB) has been successfully deployed and is running, the OData protocol support is implicitly provided by JDV without any further configuration/development.

    Now, open up a browser and point it to the following OData URLs which are out-of-the-box available for your convenience.

    Note: If you are requested to type in a username/password enter teiidUser/redhat1! or the combination you have used during the configuration of the JDV template of project jdv-demo in part 1.

    OData v2

    • Metadata
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata/country-ws/$metadata

       

      SQL equivalent> SQL varies per database vendor

    screen-shot-2016-12-07-at-08-57-40

    • Querying data
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata/country-ws/country.Countries?$format=json

       

      SQL equivalent> select * from country.Countries;

    screen-shot-2016-12-07-at-16-29-43

     

    • Querying data on primary key
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata/country-ws/country.Countries('Zimbabwe')?$format=json

       

      SQL equivalent> select * from country.Countries where name='Zimbabwe';

    screen-shot-2016-12-07-at-08-58-02

    • Querying data and returning specific fields
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata/country-ws/country.Countries?$select=name&$format=json

       

      SQL equivalent> select name from country.Countries;

    screen-shot-2016-12-07-at-08-59-07

    • Querying data and show top 5 results
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata/country-ws/country.Countries?$top=5&$format=json

       

      SQL equivalent> select * from country.Countries top 5;

    screen-shot-2016-12-07-at-08-59-26

    OData v4

    • Metadata
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata4/country-ws/country/$metadata

       

      SQL equivalent> SQL varies per database vendor

    screen-shot-2016-12-07-at-09-03-21

    • Querying data
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata4/country-ws/country/Countries?$format=json

       

      SQL equivalent> select * from country.Countries;

    screen-shot-2016-12-07-at-09-03-47

    • Querying data on primary key
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata4/country-ws/country/Countries('Zimbabwe')?$format=json

       

      SQL equivalent> select * from country.Countries where name='Zimbabwe';

    screen-shot-2016-12-07-at-09-04-04

    • Querying data and returning specific fields
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata4/country-ws/country/Countries?$select=name&$format=json

       

      SQL equivalent> select name from country.Countries;

    screen-shot-2016-12-07-at-09-04-25

    • Querying data and show top 5 results
      http://datavirt-app-jdv-demo.rhel-cdk.10.1.2.2.xip.io/odata4/country-ws/country/Countries?$top=5&$format=json

       

      SQL equivalent> select * from country.Countries top 5;

    screen-shot-2016-12-07-at-09-04-39

    The returned results from OData query can be in Atom/AtomPub XML format or JavaScript Object Notation (JSON) format. Default AtomPub based XML result is returned, by specifying the $format=JSON parameter in the OData URL the results will be returned in JSON output format.

    Demonstration

    In the following video we will show the above steps on how to connect to VDBs with financial information (file) and country information (web service) in OpenShift using the OData API provided out-of-the-box by JDV.  In part 1 we deployed two VDBs called country-ws and marketdata-file. These VDBs were extracted from the github repository (https://github.com/cvanball/jdv-ose-demo/) using the templates variables

    • GitHub repository URL: https://github.com/cvanball/jdv-ose-demo)
    • Context directory: vdb.

    These VDBs were downloaded and deployed during the build and deployment process of the pod.

    Red Hat JBoss Data Virtualization on OpenShift: Part 2 - Service enable your data from Cojan van Ballegooijen on Vimeo.

    Conclusion

    You can leverage these OData-based REST services provided out-of-the-box by JDV running on OpenShift to integrate these data services with your existing applications and infrastructure like:

    • API Management
    • Enterprise Service Bus
    • Mobile applications
    • Web applications
    • etc.

    Resources

    • Red Hat JBoss Data Virtualization on OpenShift: Part 1 – Getting started
      https://developers.redhat.com/blog/2016/12/06/red-hat-jboss-data-virtualization-on-openshift-part-1-getting-started/
    • Red Hat JBoss Data Virtualization on OpenShift: Part 3 – Data federation
      https://developers.redhat.com/blog/2016/12/14/red-hat-jboss-data-virtualization-on-openshift-part-3-data-federation/
    • Red Hat JBoss Data Virtualization on OpenShift: Part 4 – Bringing data from outside to inside the PaaS
      https://developers.redhat.com/blog/2017/01/26/red-hat-jboss-data-virtualization-on-openshift-part-4-bringing-data-from-outside-to-inside-the-paas
    • OData
      http://www.odata.org
    • JSON
      http://www.json.org/
    • AtomPub
      https://tools.ietf.org/html/rfc5023
    • OpenShift Documentation
      https://docs.openshift.com/index.html
    • JDV for OpenShift image
      Red Hat JBoss Data Virtualization for OpenShift image
    • JDV for OpenShift templates
      https://github.com/jboss-openshift/application-templates/tree/master/
    • JDV for OpenShift runtime artifacts used in this example
      https://github.com/cvanball/jdv-ose-demo
    • Documentation
      https://access.redhat.com/products/
    • Red Hat Container Catalog
      https://access.redhat.com/containers
    • OpenShift Container Tested Integrations
      https://access.redhat.com/articles/2176281
    • Red Hat JBoss Data Virtualization
      http://developers.redhat.com/products/datavirt
    • OpenShift
      http://www.openshift.com
    Last updated: October 26, 2023

    Recent Posts

    • Migrating Ansible Automation Platform 2.4 to 2.5

    • Multicluster resiliency with global load balancing and mesh federation

    • Simplify local prototyping with Camel JBang infrastructure

    • Smart deployments at scale: Leveraging ApplicationSets and Helm with cluster labels in Red Hat Advanced Cluster Management for Kubernetes

    • How to verify container signatures in disconnected OpenShift

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue