Compile an application for your COD database

Once you have created your application and a database using Cloudera Operational Database (COD), you have to compile your application for your database.

  • Set your CDP workload password. For more information, see the Setting the workload password documentation in the related information section.
  • Grant the ODUser role to the machine user using the Management Console Actions > Manage Acces page for their CDP environment. By setting the ODUser role you can grant a number of rights in the system that allows you to access the COD using the machine user's workload password.
  • Add synchronized users from User Management Service in the CDP Control Plane into the environment in which your COD database is running.
  1. Get the Maven repository location to fetch JAR files.
    There are two ways to get the necessary information:
    • In command line: Using the cdp opdb describe-client-connectivity --database-name <your_database> --environment-name <your_environment> command.
    • In the COD user interface: Clicking the Connect bar and selecting the applicable client.

    You have to use the version and the mavenURL attributes in your Maven project and configuration.

    The following is an example about how to fetch the required HBase information to build your application:
    $ cdp opdb describe-client-connectivity --database-name <your_database> --environment-name <your_environment>  | jq '.connectors[] | select(.name == "hbase")'
    {
      "name": "hbase",
      "version": "2.2.3.7.2.0.0-219",
      "kind": "LIBRARY",
      "dependencies": {
        "mavenUrl": "https://repository.cloudera.com/artifactory/cloudera-repos"
      },
      "configuration": {
        "clientConfigurationUrl": "http://client_Configuration_URL/.../services/hbase/clientConfig"
      },
      "requiresKerberos": true
    
    The following example fetch the required Phoenix information to build your application:
     cdp opdb describe-client-connectivity --database-name <your_database> --environment-name <your_environment> | jq ".connectors[] | select(.name == \"phoenix-thick-jdbc\") | .dependencies.mavenUrl"
      cdp opdb describe-client-connectivity --database-name <your_database> --environment-name <your_environment> | jq ".connectors[] | select(.name == \"phoenix-thin-jdbc\") | .version"
    
    Phoenix-thick
    "https://repository.cloudera.com/artifactory/cloudera-repos"
    "5.0.0.7.2.0.0-128"
    Phoenix-thin
    "https://repository.cloudera.com/artifactory/cloudera-repos"
    "5.0.0.7.2.0.0-128"
    
  2. Modify your application's settings.
    Ensure your application's settings.xml file uses the correct URL and version for your COD database.
    An example when using NoSQL client:
    <project>
      <dependencies>
        <!-- NoSQL client for COD -->
        <dependency>
          <groupId>org.apache.hbase</groupId>
          <artifactId>hbase-shaded-client</artifactId>
          <version>2.2.3.7.2.0.0-219</version>
        </dependency>
      </dependencies>
      ...
      <repositories>
        <!-- Define our COD repository; this would be given to us by COD itself -->
        <repository>
          <id>nosql-odx</id>
    <url>https://maven_URL/cdp-proxy/hbase/jars</url>
          <name>Cloudera NoSQL COD Repository</name>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
    </project>
    
    An example when using SQL client:
    <project>
      <dependencies>
        <!-- SQL client for ODX -->
        <dependency>
          <groupId>org.apache.phoenix</groupId>
          <artifactId>phoenix-client</artifactId>
          <version>5.0.0.7.2.0.0-128</version>
        </dependency>
        <dependency>
          <groupId>org.apache.phoenix</groupId>
          <artifactId>phoenix-queryserver-client</artifactId>
          <version>5.0.0.7.2.0.0-128</version>
        </dependency>
      </dependencies>
      ...
      <repositories>
        <!-- Define our COD repository -->
        <repository>
          <id>sql-cod</id>
    <url>https://maven_URL/cdp-proxy-api/avatica/maven</url>
          <name>Cloudera SQL COD Repository</name>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
    </project>
    
  3. Build your application.
  4. Run your application for the applicable client.