JDBC + SAP Cloud Platform = database application running in the cloud

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.

JDBC + SAP Cloud Platform = database application running in the cloud

The sample programs are located in the samples folder of the SDK.

JDBC + SAP Cloud Platform = database application running in the cloud

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

JDBC + SAP Cloud Platform = database application running in the cloud

Deploy the application to the SAP cloud platform:

JDBC + SAP Cloud Platform = database application running in the cloud

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:

JDBC + SAP Cloud Platform = database application running in the cloud

JDBC + SAP Cloud Platform = database application running in the cloud

On the contrary, JDBC solution, HANA database insert and read are implemented by PersonDAO.java.

JDBC + SAP Cloud Platform = database application running in the cloud

After the cloud deployment is complete, create a binding to the HANA database instance for the JDBC application as well:

JDBC + SAP Cloud Platform = database application running in the cloud

After that, you can find the access url of the application in Cockpit:

JDBC + SAP Cloud Platform = database application running in the cloud

The app can then be accessed on PCs and phones:

JDBC + SAP Cloud Platform = database application running in the cloud

JDBC + SAP Cloud Platform = database application running in the cloud

JDBC + SAP Cloud Platform = database application running in the cloud

To get more original technical articles from Jerry, please follow the public account "Wang Zixi" or scan the QR code below:

JDBC + SAP Cloud Platform = database application running in the cloud

JDBC + SAP Cloud Platform = database application running in the cloud

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325333063&siteId=291194637