Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This Maven project implements a REST API for managing "Alien" records. The API supports basic CRUD (Create, Read, Update, Delete) operations and is implemented using Jersey Quick Start. The database for storing the Alien data is created using JDBC, and the API is tested using Postman.

Notifications You must be signed in to change notification settings

srinivas6303/Rest_API_Jersey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alien REST API

This Maven project implements a REST API for managing "Alien" records. The API supports basic CRUD (Create, Read, Update, Delete) operations and is implemented using Jersey Quick Start.
The database for storing the Alien data is created using JDBC, and the API is tested using Postman.

Project Structure

com.srinivas.Restdemo.Alien: A Java class representing the Alien entity with fields like alienid, name, and points.
com.srinivas.Restdemo.AlienResource: This class contains the RESTful API methods to handle requests.
com.srinivas.Restdemo.AlienRepository: This class handles database operations using JDBC.
API Endpoints

  1. Get All Aliens Path: /alienresource/getAliens
    Method: GET
    Description: Retrieves a list of all aliens in the database.
    Produces: application/json, application/xml

  2. Get a Single Alien Path: /alienresource/getAlien/{id}
    Method: GET
    Description: Retrieves the details of an alien by its ID.
    PathParam: id - The ID of the alien to retrieve.
    Produces: application/json, application/xml

  3. Create a New Alien Path: /alienresource/createAlien
    Method: POST
    Description: Adds a new alien to the database.
    Consumes: application/json, application/xml

  4. Update an Existing Alien Path: /alienresource/updateAlien
    Method: PUT
    Description: Updates an existing alien record. If the alien with the given ID doesn't exist, a new record is created.
    Consumes: application/json, application/xml

  5. Delete an Alien Path: /alienresource/deleteAlien/{id}
    Method: DELETE
    Description: Deletes an alien from the database based on its ID.
    PathParam: id - The ID of the alien to delete.
    Consumes: application/json, application/xml

Database Setup

Database Name: restdb
Table Name: aliens

Columns: id (INT): Primary key, unique identifier for each alien.
name (VARCHAR): Name of the alien.
points (INT): Points associated with the alien.

Tools and Technologies Used

Java: The primary programming language used.
Maven: For managing project dependencies and building the project.
Jersey Quick Start: For implementing RESTful web services.
JDBC: For database connectivity.
MySQL: Database used to store the Alien records.
Apache Tomcat: Server used to deploy the REST API.
Postman: For testing the API endpoints.

About

This Maven project implements a REST API for managing "Alien" records. The API supports basic CRUD (Create, Read, Update, Delete) operations and is implemented using Jersey Quick Start. The database for storing the Alien data is created using JDBC, and the API is tested using Postman.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages