Skip to content

The project is a Spring Boot application for inventory management, using an Oracle database to store item details like name and count. It employs Hibernate for seamless CRUD operations and RESTful APIs for adding, updating, and retrieving items. The project is a simple and efficient solution for dynamic item tracking and management tasks.

Notifications You must be signed in to change notification settings

mohitksahu/TrackMate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrackMate

TrackMate is a Spring Boot application for inventory management, using an Oracle database to store item details like name and count. It employs Hibernate for seamless CRUD operations and RESTful APIs for adding, updating, and retrieving items. The project is a simple and efficient solution for dynamic item tracking and management tasks.

  1. From "https://maven.apache.org/download.cgi" install Binary zip archive

  2. Install JAVA JDK

  3. Install Oracle from "https://www.oracle.com/middleeast/database/technologies/oracle-database-software-downloads.html#db_free" this one "Oracle Database 21c for Microsoft Windows x64 (64-bit)"

    And set the password.

  4. Add the path of bin file from "Binary zip archive" to Environmental variables (User variables as well as System variables)

  5. In the "sbsite" folder, go to "spring-boot-oracle-integration"

  6. In terminal: mvn clean install mvn spring-boot:run

  7. Go live with HTML file


[Terminal]

Microsoft Windows [Version 10.0.19045.5247] (c) Microsoft Corporation. All rights reserved. C : \Users SQL*P1us: Release 23.Ø.Ø.Ø.Ø - Production on wed Dec 18 2024 Version 23.6.Ø.24.10 Copyright (c) 1982, 2024, Oracle. All rights reserved. Enter user-name: sqlplus / as sysdba Enter password: Connected to: Oracle Database 23ai Free Release 23.0.ø.ø.ø - Version 23.6.ø.24.10 SQL> SELECT HOST_NAME FROM V$INSTANCE; HOST NME- msi SQL> SELECT INSTANCE_NAME FROM V$INSTANCE; INSTANCE NME- FREE SQL>

In "C:\Users\kname\Desktop\sbsite\spring-boot-oracle-integration\src\main\resources\application.properties" do the changes according to obtained hostname(msi) and service name(FREE)

spring.datasource.url=jdbc:oracle:thin:@:1521:[change this according to the values you get] jdbc:oracle:thin:@hostname:port:sid[stays same] spring.datasource.username=sys[stays same] spring.datasource.password=banana[whatever oracle password you've set] spring.datasource.driver-class-name=oracle.jdbc.OracleDriver


  1. Database Table Initialization:

    • Inside the Oracle SQL*Plus terminal, create the required table for the application using the schema provided below:
      CREATE TABLE ITEM (
        ID NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
        NAME VARCHAR2(255) NOT NULL,
        COUNT NUMBER NOT NULL
      );
    • Grant necessary quotas to avoid errors:
      ALTER USER C##SCOTT QUOTA UNLIMITED ON USERS;
  2. Test the Database Connection:

    • Run the Spring Boot application:
      mvn spring-boot:run
    • Verify that the application starts successfully and connects to the Oracle database without errors.
  3. Verify Data Insertion:

    • Use a REST client like Postman to test the /api/items endpoint:
      • POST request: URL: http://localhost:8080/api/items Body:
        {
          "name": "item1",
          "count": 10
        }
      • Check the Oracle database to ensure the data is inserted using SQL*Plus:
        SELECT * FROM ITEM;
  4. HTML Integration:

    • To integrate the HTML frontend:
      • Serve the static HTML file via a simple HTTP server or IDE live server plugin.
      • Ensure the API calls from the frontend point to the Spring Boot application running at http://localhost:8080.
  5. Running Locally for Other Users:

    • Steps to adapt if a different user sets up the project locally:
      • Update application.properties with their Oracle database credentials:
        • hostname
        • service name
        • username
        • password
      • Ensure the necessary software versions (JDK, Maven, Oracle) are compatible with their system.
      • Re-run the commands for database setup and table creation.
  6. Debugging Tips:

    • If you encounter a quota error, check user quotas:
      SELECT USERNAME, TABLESPACE_NAME, BYTES/1024/1024 AS MB FROM DBA_TS_QUOTAS;
    • For invalid hostname or service name issues, verify the output of:
      SELECT HOST_NAME, INSTANCE_NAME FROM V$INSTANCE;
    • Check Spring Boot logs for detailed errors and address any missing configurations or driver issues.

About

The project is a Spring Boot application for inventory management, using an Oracle database to store item details like name and count. It employs Hibernate for seamless CRUD operations and RESTful APIs for adding, updating, and retrieving items. The project is a simple and efficient solution for dynamic item tracking and management tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published