Code Monkey home page Code Monkey logo

springboot-jpa's Introduction

SpringBoot JPA

A well packaged basic implementation of springboot JPA using spring data and Java Persistence API's.

Original content from JavaTpoint, only change is the package organization.

Getting Started

Clone this repo to your local machine How To Guide

Prerequisites

Installing

Install all project dependencies with:

$ mvn install

How to run

Maven

Open a terminal and run the following commands to ensure that you have valid versions of Java and Maven installed:

$ java -version

$ mvn -v

You should get the versions of Java and Maven.

Using the Maven Plugin

The Spring Boot Maven plugin includes a run goal that can be used to quickly compile and run your application. Applications run in an exploded form, as they do in your IDE. The following example shows a typical Maven command to run a Spring Boot application:

$ mvn spring-boot:run

####Using Executable Jar

To create an executable jar run:

$ mvn clean package

Testing - From JavaTpoint

Step 19: Open the browser and invoke the URL http://localhost:8080/. It returns an empty list because we have not added any user in the List.

To add a user to the database, we will send a POST request by using the Postman.

Step 20: Open the Postman and do the following:

Select the POST

Invoke the URL http://localhost:8080/add-user.

Click on the Body

Select Content-Type as JSON(application/json).

Insert the data which want to insert in the database. We have inserted the following data:

{  
    "id": "001",  
    "name": "john",  
    "email": "[email protected]"  
}  

When we click on the Send button, it shows Status:200 OK. It means the request has been successfully executed.

Step 21: Open the browser and invoke the URL http://localhost:8080. It returns the user that we have inserted in the database.

Built With

springboot-jpa's People

Contributors

kikiodazie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.