Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clintonbrito/demo-oracledb
This is a demo project for Spring Boot with Oracle Database integration via Docker.
https://github.com/clintonbrito/demo-oracledb
Last synced: about 2 months ago
JSON representation
This is a demo project for Spring Boot with Oracle Database integration via Docker.
- Host: GitHub
- URL: https://github.com/clintonbrito/demo-oracledb
- Owner: clintonbrito
- Created: 2024-10-29T16:09:29.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-29T17:09:18.000Z (2 months ago)
- Last Synced: 2024-10-29T18:36:41.277Z (2 months ago)
- Language: Java
- Homepage:
- Size: 193 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Demo OracleDB
This is a demo project for Spring Boot with Oracle Database integration.
## Prerequisites
- Java 17
- Maven 3.9.9
- Docker## Getting Started
1. **Clone the repository:**
```sh
git clone https://github.com/clintonbrito/demo-oracledb.git
cd demo-oracledb
```
2. **Start the Oracle Database. This can take a while until the database is up and running:**```sh
docker compose up
```3. **After the database is up, you need to run the `data.sql` script to create the table and insert some data. You can use SQL Developer or any other tool to run the script.**
![Print](sql-script.png)
4. **Build the project:**
```sh
./mvnw clean install
```
5. **Run the application:**
```sh
./mvnw spring-boot:run
```## Configuration
Don't forget to configure your database connection in `src/main/resources/application.properties`:
```
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
```## Endpoints
- **GET /employees:** Retrieve a list of employees.
- **POST /employees:** Add a new employee.
- **GET /employees/{id}:** Retrieve an employee by ID.
- **PUT /employees/{id}:** Update an employee by ID.
- **DELETE /employees/{id}:** Delete an employee by ID.