You’re at the site about Three.js. How you will get data from your Java-server is up to you. In the rest we have that question about converting 2D coordinates to 3D coordinates on the 3D model of roads.
I’d offer to use THREE.Raycaster() with the origin somewhere much higher the model of roads, kind of THREE.Vector3( fetchedX, height, fetchedY ) (and I won’t be surprised, if you you have to swap values of the fetched x and y, as you work with geodesic data), and its direction is always THREE.Vector3( 0, -1, 0 );.
@sandipnd31 I mentioned Fetch API, XMLHttpRequest, and jQuery.ajax above. You should Google those and learn how to fetch data with those. Anyways, that’s a separate topic than Three.js. So once you research those things and learn to use one of them, you can fetch data, then come back here if you need help with the Three.js part.
Also, check out stackoverflow.com. Make an account there, and ask programming questions about how to fetch data from a server with JavaScript.