In the previous article JPA + EclipseLink + SAP Cloud Platform = Database application running in the cloud I introduced how to operate a HANA database instance deployed 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 sample program from this link .
Click this hyperlink to download the Java Web Tomcat 8 SDK.
The sample programs are located in the samples folder of the 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:
Different from the example of JPA + EclipseLink, in this example of JDBC, the model class Person does not need to add any Annotation, compare the Person.java implementation of these two solutions:
On the contrary, JDBC solution, HANA database insert and read are implemented by PersonDAO.java.
After the cloud deployment is complete, create a binding to the HANA database instance for the JDBC application as well:
After that, you can find the access url of the application in Cockpit:
The app can then be accessed on PCs and phones:
To get more original technical articles from Jerry, please follow the public account "Wang Zixi" or scan the QR code below: