Vehicle Management System Project In Java With Source Code

Vehicle Management System Project In Java With Source Code

The Vehicle Management System Project In Java was developed in JAVA Programming using NetBeans IDE, we created this Java Project with Source Code.

It is designed using Graphical User Interface (GUI), and this project was built in Java using Microsoft Access as the backend database and SQL for queries.

A Vehicle Service Management System Project In Java’s aim is to develop an offline application that could manage vehicles, drivers as well as the passengers could book the rides.

About The Vehicle Management System In Java

Project Name:Vehicle Management System
Language/s Used:JAVA
Database:MySQL
Type:Desktop/web Application
Developer:IT SOURCECODE
Updates:0
Vehicle Management System In Java– Project Information

There are mainly 5 modules in this project

  • Vehicle Management – Admin can add new vehicles, and manage them.
  • Driver Management – A new driver can sign up, pick up the kind of vehicle he drives and he’ll be alloted a vehicle according to his selection. He can then turn his status online and start picking rides.
  • Passenger Management – New passengers can sign up and login into the system to book rides. They can book a ride, and check their current rides and also past rides.
  • Rides Management – Admin can manage the rides going on. An admin can even ban a driver.
  • Booking Ride – Ride booking is done by the passengers where they can choose from 3 types of vehicles i.e. Bus, Rickshaw, and Car. They have to select the routes and begin traveling.

This JAVA Project also includes a Simple Project In Java NetBeans With Source Code for free, just find the downloadable source code below and click to start downloading.

To start executing a Vehicle Management System Project In Java With Source Code, make sure that you have  NetBeans IDE or any platform of Java installed on your computer.

Vehicle Management System Project In Java With Source Code: Steps on how to run the project

Time needed: 5 minutes

These are the steps on how to run a Vehicle Management System Project In Java With Source Code

  • Step 1: Download the source code.

    First, download the source code given below.
    download source code

  • Step 2: Extract file.

    Second, after you finish downloading the source code, extract the zip file.
    vehicle management system zip file

  • Step 3: Open Netbeans.

    Third, open “Netbeans IDE”.
    vehicle management system open netbeans

  • Step 4: Click open project.

    Fourth, click Open Project and choose your download source code.
    vehicle management system open project

  • Step 5: Run the project.

    Fifth, right-click the project folder and click run.
    vehicle management system run project

The code given below is for the connection under Java and MS Access

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package vehler;

/**
 *
 * @author user
 */
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Muaaz
 */

public class DbConnection {
     
    private static Connection connection = null;
    PreparedStatement pst = null;
    ResultSet rst = null;
    public Connection OpenConnection (){
        
            String dataSourceName = "DataBase/try2.accdb";
            String dir = System.getProperty("user.dir");
            String url = "jdbc:ucanaccess://" + dir + "/" + dataSourceName;
     
     connection = null;
      try{
          connection =   DriverManager.getConnection(url);
      }catch(Exception e){
          System.out.println(e);
      }
      return connection;
    }
    
    public  ResultSet GetData(String Sql)// this method is used for Select Statement
    {
        try {
            pst = connection.prepareStatement(Sql);
             rst = pst.executeQuery();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, ex + "\nDbConnection GetData Error");
        }
        return rst;
    }
    
    public int InsertUpdateDelete(String Sql)// this method is used for InsertUpdateDelete Statement
    {
        int flag=0;
        try {
            pst = connection.prepareStatement(Sql);
            flag = pst.executeUpdate();
        } catch (SQLException ex) {
            
        }
         return flag ;
    }
    
    public void CloseConnection(){
        
    if (rst != null) {
        try {
            rst.close();
        } catch (SQLException e) { /* ignored */}
    }
    if (pst != null) {
        try {
            pst.close();
        } catch (SQLException e) { /* ignored */}
    }
    if (connection != null) {
        try {
            connection.close();
        } catch (SQLException e) { /* ignored */}
    }

    }
}

In this module which is the class for the connection under java and microsoft access database.

The code given below is for the admin module

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package vehler;

/**
 *
 * @author user
 */import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
public class Admin {

    /**
     * @param args the command line arguments
     */
    DbConnection conn = new DbConnection();
    PreparedStatement pst = null;
    ResultSet rst = null;
   public void changePassword(String username,String newPassword)
    {
        int flag;
        
         try{
        conn.OpenConnection();
        String sql = "UPDATE Admint SET AdminP = '"+ newPassword +"' where AdminID = '"+username+ "'";
       
        flag = conn.InsertUpdateDelete(sql);
           if(flag == 1){
               JOptionPane.showMessageDialog(null, "YOUR PASSWORD HAS BEEN CHANGED  ");
           }
           else{
                JOptionPane.showMessageDialog(null, "YOUR PASSWORD COULDn't BE CHANGED" );
           }
        }
        catch(Exception e){
             JOptionPane.showMessageDialog(null, "UpdatePassword Query Failed");
        }
        
    }
    public boolean chkAdminPass(String id, String pass){
        boolean flag = false;
        
        try{
            conn.OpenConnection();
            String sql = "Select AdminID,AdminP from AdminT where AdminID = '" + id + "' and AdminP = '" + pass + "'";
            rst= conn.GetData(sql);
            if(rst.next()){
                flag= true;
                              
            }
            else 
                flag=  false;
            conn.CloseConnection();
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e+"\nInavlid Username or Password");
        }
       return flag; 
    }
    public ResultSet RideRealTimeCombined()
    {
        ResultSet rst1=null;
    
        
        try{
            conn.OpenConnection();
            String sql = "Select Datee,Username,VehiclePlate,PUsername,Fromm,Too,StartTime,EndTime,RideStatus,BillStatus,Bill,NoOfPassengers from RideRealtime ";
            rst1= conn.GetData(sql);
                   do{
                return rst1;
            } 
            while(rst1.next());
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e+"\nRide Realtime Combined Error");
        }
          
        conn.CloseConnection();
        return null;
    }
    
}

In this module which is the class for the administrator.

Output:

Vehicle Management System Project In Java Add Vehicle
Add Vehicle

Vehicle Management System Project In Java Admin Page
Admin Page

Vehicle Management System Project In Java Admin Setting
Admin Setting

Vehicle Management System Project In Java Ban Driver
Ban Driver

Vehicle Management System Project In Java Book Bus
Book Bus

Vehicle Management System Project In Java Book Ride
Book Ride

Vehicle Management System Project In Java Current Ride
Current Ride

Vehicle Management System Project In Java Driver Home
Driver Home

Vehicle Management System Project In Java Driver Registration
Driver Registration

Vehicle Management System Project In Java Driver Ride
Driver Ride

Vehicle Management System Project In Java Driver Setting
Driver Setting

Vehicle Management System Project In Java Forgot Password
Forgot Password

Vehicle Management System Project In Java Login Page
Login Page

Downloadable Source Code Below

Anyway, if you want to level up your programming knowledge, especially Java, try this new article I’ve made for you Best Java Projects With Source Code For Beginners Free Download.

Summary

The Java Project With Source Code is built fully in Java and MySQL Database. It has a full-featured Graphical User Interface (GUI) with all the functionalities.

This Article is a way to enhance and develop our skills and logic ideas which is important in practicing the Java programming language which is the most well-known and most usable programming language in many companies.

This Simple Project also includes a downloadable source code for free.

Inquiries

If you have any questions or suggestions about the Vehicle Management System Project In Java With Source Code, please feel free to leave a comment below.

12 thoughts on “Vehicle Management System Project In Java With Source Code”

Leave a Comment