Hello!
I'm writing a client-side application that would read info from server database through Apache and PHP. However, when I send a request to the PHP script:
URL url = new URL(Main.URLPATH+"getTracksByCoord.php?"+"track="+TrackListInfo.tablename+"&chr="+chr+"&from="+from+"&to="+to);
URLConnection conn = url.openConnection();
conn.connect();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
and then start reading the data prited by PHP script in a cycle:
while ((String line = in.readLine()) != null ){
.................................
}
it appears that Java reads faster then the script prints rows, which leads that BufferedReader ends prematurely.
Is there any way to make client-side Java application wait until the server-side script finishes printing data?
Regards,
Nickolai Samusik,
St.Petersburg, Russia
I'm writing a client-side application that would read info from server database through Apache and PHP. However, when I send a request to the PHP script:
URL url = new URL(Main.URLPATH+"getTracksByCoord.php?"+"track="+TrackListInfo.tablename+"&chr="+chr+"&from="+from+"&to="+to);
URLConnection conn = url.openConnection();
conn.connect();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
and then start reading the data prited by PHP script in a cycle:
while ((String line = in.readLine()) != null ){
.................................
}
it appears that Java reads faster then the script prints rows, which leads that BufferedReader ends prematurely.
Is there any way to make client-side Java application wait until the server-side script finishes printing data?
Regards,
Nickolai Samusik,
St.Petersburg, Russia