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,


<!DOCTYPE html>
<html lang="en">
    <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>
    <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>

    <script type="text/javascript">
    $(document).ready(function() {
        $('#dop').change(function() {
            var selectedDop = $(this).val();
                url: 'DataFetchServlet',
                type: 'GET',
                data: { dop: selectedDop },
                success: function(data) {
                error: function() {
                    alert('Failed to retrieve data.');

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 {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String dop = request.getParameter("dop");
        Gson gson = new Gson();
        Connection con=null;
        try {
        	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(
        } catch (SQLException | ClassNotFoundException ex) {