In the previous article, I described how JPA + EclipseLink + SAP Cloud Platform = Database application running in the cloud can operate HANA database instances deployed on SAP cloud platform through JPA and EclipseLink.

In this article, we use JDBC instead of JPA and Eclipse to accomplish the same task.

Download the sample program from this link.

Click the hyperlink to download the Java Web Tomcat 8 SDK.

The sample program is located under the Samples folder of this SDK.

After importing into Eclipse, you also need to change its Targeted Runtimes to Java Web Tomcat 8.

Deploy the application to the SAP cloud platform:

Unlike the JPA + EclipseLink example, in this JDBC example, the model class Person does not require any annotations. Compare the Person.java implementation of the two solutions:

In contrast, the JDBC solution, HANA database inserts and reads are implemented by Persondao.java.

After cloud deployment is complete, create a binding between the JDBC application and the HANA database instance:

The app’s url can then be found in Cockpit:

You can then access the app on your PC and phone:

For more of Jerry’s original technical articles, please follow the public account “Wang Zixi” or scan the following QR code: