I want the data in the html form i.e come from the Database when i select the dop(date of photography) in the form using JAVA as a Backend

So I’m creating a form for my project Dynamic Web Application in eclipse IDE I want that when I select dop a query will fire to database i.e. postgresql and the remaining data is filled based on the dop from the database using JAVA(for Backend),JavaScript AJAX,and HTML,

Index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Dynamic Satellite Data Form</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
    <label for="dop">Date of Performance (DOP):</label>
    <input type="date" id="dop">
    <div id="dataDisplay">
        <p>Path: <input type="text" id="path" disabled /></p>
        <p>Orbit: <input type="text" id="orbit" disabled /></p>
        <p>Start Row: <input type="number" id="startrow" disabled /></p>
        <p>End Row: <input type="number" id="endrow" disabled /></p>
        <p>Pass Type: <input type="text" id="passtype" disabled /></p>
        <p>Purpose: <input type="text" id="purpose" disabled /></p>
        <p>Station: <input type="text" id="station" disabled /></p>
        <p>Cloud: <input type="text" id="cloud" disabled /></p>
        <p>Indian Region Check: <select id="irc" disabled><option value="true">Yes</option><option value="false">No</option></select></p>
    </div>

    <script type="text/javascript">
    $(document).ready(function() {
        $('#dop').change(function() {
            var selectedDop = $(this).val();
            $.ajax({
                url: 'DataFetchServlet',
                type: 'GET',
                data: { dop: selectedDop },
                success: function(data) {
                    $('#path').val(data.path);
                    $('#orbit').val(data.orbit);
                    $('#startrow').val(data.startRow);
                    $('#endrow').val(data.endRow);
                    $('#passtype').val(data.passType);
                    $('#purpose').val(data.purpose);
                    $('#station').val(data.station);
                    $('#cloud').val(data.cloud.toString());
                    $('#irc').val(data.indianRegionCheck.toString());
                },
                error: function() {
                    alert('Failed to retrieve data.');
                }
            });
        });
    });
    
    
    </script>
</body>
</html>

PerformanceData.java. (Getters and Setters)

package com.uirequest;

public class PerformanceData {
    private int path;
    private int orbit;
    private int startrow;
    private int endrow;
    private String passtype;
    private String purpose;
    private String station;
    private int cloud;
    private boolean irc;

    // Constructor with all fields
    public PerformanceData(int path, int orbit, int startrow, int endrow,
                           String passtype, String purpose, String station, int cloud, boolean irc) {
        this.path = path;
        this.orbit = orbit;
        this.startrow = startrow;
        this.endrow = endrow;
        this.passtype = passtype;
        this.purpose = purpose;
        this.station = station;
        this.cloud = cloud;
        this.irc = irc;
    }

	public int getPath() {
		return path;
	}

	public void setPath(int path) {
		this.path = path;
	}

	public int getOrbit() {
		return orbit;
	}

	public void setOrbit(int orbit) {
		this.orbit = orbit;
	}

	public int getStartrow() {
		return startrow;
	}

	public void setStartrow(int startrow) {
		this.startrow = startrow;
	}

	public int getEndrow() {
		return endrow;
	}

	public void setEndrow(int endrow) {
		this.endrow = endrow;
	}

	public String getPasstype() {
		return passtype;
	}

	public void setPasstype(String passtype) {
		this.passtype = passtype;
	}

	public String getPurpose() {
		return purpose;
	}

	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}

	public String getStation() {
		return station;
	}

	public void setStation(String station) {
		this.station = station;
	}

	public int getCloud() {
		return cloud;
	}

	public void setCloud(int cloud) {
		this.cloud = cloud;
	}

	public boolean isIrc() {
		return irc;
	}

	public void setIrc(boolean irc) {
		this.irc = irc;
	}
    
    
    
}

GetDataServlet.java Servlet file

package com.uirequest;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import com.google.gson.Gson;
import jakarta.servlet.*;
import jakarta.servlet.http.*;
import java.io.IOException;
import java.sql.*;
// @WebServlet(DataFetchServlet);
@WebServlet(name = "DataFetchServlet", urlPatterns = {"/DataFetchServlet"})

public class DataFetchServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String dop = request.getParameter("dop");
        Gson gson = new Gson();
        Connection con=null;
        try {
        	Class.forName("org.postgresql.Driver");
        	con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/SatelliteTestData", "postgres", "1729");
             PreparedStatement pst = con.prepareStatement("SELECT * FROM Performances WHERE dop = ?");
            pst.setDate(1, Date.valueOf(dop));
            ResultSet rs = pst.executeQuery();

            if (rs.next()) {
                PerformanceData data = new PerformanceData(
                    rs.getInt("path"),
                    rs.getInt("orbit"),
                    rs.getInt("startrow"),
                    rs.getInt("endrow"),
                    rs.getString("passtype"),
                    rs.getString("purpose"),
                    rs.getString("station"),
                    rs.getInt("cloud"),
                    rs.getBoolean("irc")
                );
                response.setContentType("application/json");
                response.setCharacterEncoding("UTF-8");
                response.getWriter().write(gson.toJson(data));
            }
        } catch (SQLException | ClassNotFoundException ex) {
            ex.printStackTrace();
        }
    }
}