Apache HBase Data Source
This article includes information about how to install the Apache HBase JDBC driver, how to connect to an Apache HBase database, and a list of the HBase data types that supports. With the JDBC driver installed, the HBase data source is available as an option in the connection wizard when creating an API.
This article includes information about how to install the Apache HBase JDBC driver, how to connect to an Apache HBase database, and a list of the HBase data types that
CA Live API Creatorsupports. With the JDBC driver installed, the
HBasedata source is available as an option in the connection wizard when creating an API.
In this article:
Install the Apache HBase JDBC Driver
The self-contained, single-user version of
CA Live API Creatorthat is based on Jetty includes the Apache HBase JDBC driver. The JDBC driver is located in the
%JETTY_HOME%/caliveapicreator/lib/extdirectory. If you have installed this version of
CA Live API Creator, no additional steps are required to install the JDBC driver.
If you have installed
CA Live API Creatoron another Java container, such as Apache Tomcat, copy the
cdata.jdbc.apachehbase.jarJAR file (the JDBC driver) that is located in the
databaseDriversdirectory into the directory that is based on the Java container on which you have installed
CA Live API Creator:
Copy the JDBC driver into the
Copy the JDBC driver to the
<Your WebLogic Domain Directory>/libdirectory.
Add the JDBC driver to your Web application server.
Using the WebSphere administrative console, create a JDBC provider for the driver in the server.
For more information about how to create a JDBC provider, see the IBM WebSphere documentation.
For more information:
Connect to an HBase Database
You can connect to your HBase database using the following methods:
- (If you have not created your API yet) When you create your API.For more information about how to create an API, see Creating APIs.
- (If you have an existing API) By adding a connection to an HBase data source.For more information about how to add a connection to a data source, see Database Connectivity.
The following procedure details how to connect to your HBase database when creating your API.
Prerequisite:You know your HBase REST connection information. For more information about how to start the REST server, see the Apache HBase documentation.
Follow these steps:
- In API Creator, on the APIs page, clickCreate New API.The connection wizard opens.
- ClickDatabase First.
- SelectApache HBaseas the data source type.
- Complete the following fields, and then clickContinue:REST ServerThe server name or IP address.Example:127.0.0.1REST PortThe port number running the HBase REST service. The JDBC driver attaches to and reads tables and columns by connecting to HBase using the REST port (for example, 2199).Example:2199
You are connected to the HBase database.
Make all Columns VARCHAR and Turn Off Types
The HBase JDBC driver does not know about your schema. The driver tries to approximate the actual datatypes by scanning the data. The driver samples the first N rows to determine the column names and types. You can make all columns VARCHAR and can turn off types by adding the following line to the JDBC URL:
HBase Supported Data Types
You can read and write the following HBase data types:
When you are setting up a connection to an external data source,
CA Live API Creatormust map the data types in the data source to data types in
CA Live API Creator. The following table lists the different data type mappings applicable when working with an HBase database.
CA Live API Creatorsupports read and write of the following data types:
HBase Data Source Limitations
The following limitations are known in HBase data sources.
Display of Column Names in Data Explorer
If a column name contains a colon (:) character, you cannot view HBase data in the Main Grid and the Child Grid in Data Explorer.
For more information about Data Explorer, see Data Explorer.
Implement Transaction Logic
You can implement transaction logic in
CA Live API Creatoronly by creating early event rules or pre-insert event rules.
For more information about event rules, see Event Rule Types.