https://github.com/srinivas6303/rest_api_jersey
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.
https://github.com/srinivas6303/rest_api_jersey
java jdbc jersey postman restful-api server
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/srinivas6303/rest_api_jersey
- Owner: srinivas6303
- Created: 2024-08-28T15:17:34.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-08-28T16:06:31.000Z (10 months ago)
- Last Synced: 2025-03-26T20:13:47.761Z (3 months ago)
- Topics: java, jdbc, jersey, postman, restful-api, server
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 Endpoints1. Get All Aliens
Path: /alienresource/getAliens
Method: GET
Description: Retrieves a list of all aliens in the database.
Produces: application/json, application/xml2. 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/xml3. Create a New Alien
Path: /alienresource/createAlien
Method: POST
Description: Adds a new alien to the database.
Consumes: application/json, application/xml4. 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/xml5. 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: aliensColumns:
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.