Quantcast
Channel: SCN : Blog List - Java Development
Viewing all articles
Browse latest Browse all 50

Create sample web service to save data in Java Table using EJB and JPA.

$
0
0

  These documents will help you to creating the web service for updating the data in java table using EJB and JPA.

1.     Create Dictionary DC from Dictionary Perspective.

1.png

2.     Create Table in dictionary.

2.png

3.     Build and deploy the Dictionary DC.

4.     Create EJB  application-Select DC type as EJB Module.

4.png

5.     Give EJB application name and click next.

5.png

6.     Select JPA and finish.

6.png

7.     Create Enterprise application for EJB application .

7.png

8.     Give name of enterprise application.

8.png

9.     Add  ejb application(test_app) to ear project and finish.

9.png

10.     Select Sap data source aliases provider module of the ear DC from project facets and apply.

10.png

11.     Check alias name of data base in the ear app.

11.png

12.     Open data-source-aliases.xml from META-INF folder and note the alias name.

12.png

13.     Create  connection from EJB application to dictionary.

13.png

14.     Define Alias name in persistence.xml.

14.png

15.     Generate Entities from Table in EJB.

15.png

16.     After creating the entity class, code as below.

16.png

17.     Create class for dto in EJB.

17.png

18.     Generate the getter and setter for this variable.

18.png

19.     Create an interface in the EJB DC and declare save method as below.

19.png

20.     Create a session bean in EJB DC.

20.png

21.     Include Entity Manager and Persistence Context in session bean.

21.png

22.     Define save operation in session bean.

22.png

23.     Create a web service for session bean.

23.png

24.     Build and deploy the EAR and EJB project.

25.     Test the web service from WSNavigator.


Viewing all articles
Browse latest Browse all 50

Trending Articles