In the previous article JPA + Eclipselink + SAP Cloud Platform = database application running in the cloud I described how to deploy a Hana DB instance on the SAP cloud platform through JPA and eclipselink operations.
In this article, we use JDBC instead of JPA and eclipse to accomplish the same task.
Download the example program from this link.
Click on the hyperlink to download the Java Web Tomcat 8 SDK.
The example program is located under the Samples folder of the SDK.
After importing to eclipse, it is also necessary to change its targeted runtimes to Java Web Tomcat 8.
Deploy the app to the SAP Cloud Platform:
Unlike the JPA + Eclipselink example, in this example of JDBC, the model class person does not need to add any annotation to compare the Person.java implementations of these two solution:
Conversely, the JDBC solution, the insertion and reading of the Hana database, is implemented by Persondao.java.
Once the cloud deployment is complete, you also create a binding for the JDBC application with the Hana DB instance:
You can then find the app's access URL in cockpit:
You can then access the app on your PC and phone:
To get more original Jerry's technical articles, please follow the public number "Wang Zixi" or scan the QR code below:
JDBC + SAP Cloud Platform = database application running in the cloud