The JPA sample contains a server definition which includes the Servlet, JDBC and JPA features. It also contains a very simple JPA application, jpaApp.war, which contains a single servlet, JPAServlet. This servlet persists a JPA entity (named "Thing") to a derby database and then retrieves the entiry from the database.
This sample can be installed onto runtime versions 22.214.171.124 and later.
Online installation (requires 126.96.36.199 or later):
installUtility install jpaSample
Any missing features required by the server will be installed for you.
jpaSample.jarusing the download button at the top of the page and place it in the root of your server installation.
java -jar jpaSample.jar
Any missing features required by the server will need to be installed separately.
To run the jpaApp application:
bindirectory in the Liberty profile installation:
server run jpaSample
CWWKZ0001I: Application jpaApp started in XX.XX seconds.
Hello JPA Worldfollowed by information about the entity being persisted to and retrieved from the database.
jpaApp.war file contains the source and binaries for the application, and can be used to import it to Eclipse.