Host the OData Connector on Heroku

This entry shows how to obtain the connection properties you need to use any CData data provider to connect to SAP.

Date Entered: 10/15/2014    Last Updated: 10/15/2014

Consume your data from smart phones and cloud-based applications such as Salesforce Lightning Connect: You can deploy the CData OData Connector for your data source to Heroku in 10 steps. CData OData Connectors are lightweight Web applications for Windows and Java that produce an OData feed for a single data source. In this article we show how to use the Webapp Runner Tomcat container and the Heroku Maven plugin to deploy the OData Connector for NetSuite. You can follow a similar procedure for Jetty Runner. You can follow the same steps to deploy a OData Connector for another data source.

  1. Install the Heroku Toolbelt, as well as the Java edition of the CData OData Connector.
  2. On the Resources tab for your app, click enter Heroku Postgres in the Add-Ons box, add the database, and click Provision.

    The cloud driver for NetSuite persists connection settings and NetSuite schemas in this database.

  3. On the Settings tab for your app, click Reveal Config Vars and add the following configuration variables:
    • Set the APP_DB variable to a valid JDBC connection string to the PostgreSQL database you provisioned. The syntax is below: jdbc:postgresql://AddressOnAmazonAWS.com:5432/MyDatabaseName?user=MyUsername&password=MyPassword Use the following parts from DATABASE_URL to obtain the parts of the JDBC connection string: postgres://user:password@AddressOnAmazonAWS.com:5342/MyDatabaseName
    • Set the WEBAPP_RUNNER_OPTS variable to the following: --tomcat-users-location ../../tomcat-users.xml

      The administrator for the OData Connector for NetSuite is defined in tomcat-users.xml. Note that the path to tomcat-users.xml is relative to the Webapp Runner JAR, the Tomcat container that runs your Web application.

  4. Configure authentication for the administrator of the OData Connector for NetSuite: Create a tomcat-users.xml file with the cdata_admin role. You can use the following tomcat-users.xml, based on the default file in a standalone Tomcat installation:

  5. Enter the following command to generate the pom.xml for a Web application. You are prompted to enter the groupId, artifactId, and package. This example uses com.cdata for the groupId and package and netsuite for the artifactId. A folder named netsuite containing a Web application is generated.

    mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp
  6. Remove Web.xml from src\main\webapp\WEB-INF and remove index.jsp from src\main\webapp.
  7. To add the Heroku Maven plugin, add the following to the plugins node inside the build node of your pom.xml: <plugins> ... <plugin> <groupId>com.heroku.sdk</groupId> <artifactId>heroku-maven-plugin</artifactId> <version>0.4.4</version> </plugin> </plugins>
  8. Add the following to the configuration element for the Heroku Maven plugin. This will configure the plugin to configure forms-based authentication for the cloud driver administrator through your tomcat-users.xml. <configuration> <includes> <include>tomcat-users.xml</include> </includes> <appName>YourAppName</appName> </configuration>
  9. Add a dependency for the netsuite.war: <dependency> <groupId>com.cdata</groupId> <artifactId>netsuite</artifactId> <version>15.0</version> <type>war</type> </dependency>
  10. Add a dependency for the PostgreSQL JDBC driver:

    <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.4-1201-jdbc41</version> </dependency>
  11. Add the Maven WAR Plugin: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> </plugin>
  12. Install netsuite.war into your local Maven repository: mvn -U install:install-file -Dfile=netsuite.war -Dg roupId=com.cdata -DartifactId=netsuite -Dversion=15.0 -Dpackaging=war -DgeneratePom=true
  13. Execute the following command to deploy the WAR: mvn clean heroku:deploy-war
  14. You can open the cloud driver for NetSuite by entering the following command: heroku open

You can now log into the cloud driver. See the Getting Started chapter in the help documentation for a guide to setting required connection properties, allowing access to tables, and making OData queries.


We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry, please contact our support team at support@cdata.com.