使用下面显示的编码,我设法使用 php 从服务器中的 sql 数据库中检索数据。我需要定期检查数据库以查看是否添加了任何新数据,如果有,我需要将它们检索到我的 java 应用程序中。我正在使用 netbeans IDE 我该怎么做?
try {
    URL url = new URL("http://taxi.com/login.php?param=10");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    conn.setRequestProperty("Accept", "application/json");
    if (conn.getResponseCode() != 200) {
        throw new RuntimeException("Failed : HTTP error code : "
                + conn.getResponseCode());
    }
    BufferedReader br = new BufferedReader(new InputStreamReader(
        (conn.getInputStream())));
    String output;
    System.out.println("Output from Server .... \n");
    while ((output = br.readLine()) != null) {
        System.out.println(output);
    }
    conn.disconnect();
  } catch (MalformedURLException e) {
    e.printStackTrace();
  } catch (IOException e) {
    e.printStackTrace();
  }
}