Skip to content

charroux/CorrectionWebServiceJPA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CorrectionWebServiceJPA

This project expose JPA classes with a Rest web service. Data are stored in a H2 SQL database.

Compatibility

Java 11

The web service

https://github.com/charroux/CorrectionWebServiceJPA/blob/master/src/main/java/com/univ/CarRentalController.java

The JPA class

https://github.com/charroux/CorrectionWebServiceJPA/blob/master/src/main/java/com/univ/Car.java

The Database access

https://github.com/charroux/CorrectionWebServiceJPA/blob/master/src/main/java/com/univ/CarRepository.java

Cross origin security

https://en.wikipedia.org/wiki/Cross-origin_resource_sharing

@CrossOrigin(origins = "http://localhost:4200") in https://github.com/charroux/CorrectionWebServiceJPA/blob/master/src/main/java/com/univ/CarRentalController.java

Launching

Open the project inside Intellij or Import as Gradle project inside Eclipse

Run the main program: https://github.com/charroux/CorrectionWebServiceJPA/blob/master/src/main/java/com/univ/CorrectionWebServiceJpaApplication.java

Check the database

Verify the database content using the H2 web console: http://localhost:8080/h2-console

Then modify the JDBC URL with the good one provided into the Eclipse or Intellij console. Here is an example:

H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:dca7f3e9-95e2-425d-9ccf-c0aa71824aa1'

Test

http://localhost:8080/cars

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages