The implementation of the JPA (Java persistence API) provider has HIBERNATE,OPENJPA, Eclipselink, and so on.
This article describes how to connect Hana DB instances on the SAP cloud Platform through JPA + eclipse.
1. Log in to SAP Cloud Platform cockpit to create a new Hana DB instance:
Set the database ID and password for system user.
After successful creation, the HANA DB instance state is creating:
After a moment, the status becomes started, which is available.
2. The next step is to develop a Java application that uses JPA to operate this cloud-based DB instance.
The SDK for the SAP Cloud Platform Neo Environment comes with a JPA Hello World app, located under folder samples and named PERSISTENCE-WITH-JPA:
Direct import into Eclipse, targeted runtimes selected as Java Web Tomcat 8:
Then deploy the app from eclipse to the SAP Cloud Platform:
After successful deployment, get the app's access URL in the SAP Cloud Platform cockpit:
3. Bind the deployed Java application to the Hana DB instance created in the first step:
The binding succeeds so that the Java application can use the Hana DB instance in the cloud.
Test in a PC browser. This Hello World JPA app only designed a table that contains the first name and last name two columns.
On the phone side of the access:
To get more original Jerry's technical articles, please follow the public number "Wang Zixi" or scan the QR code below:
JPA + eclipselink + SAP Cloud Platform = database application running in the cloud