java and php get request
<p>i want to make an application which is based on a php page, sending to it parameters to obtain data from the remote db through the php page.</p>

<p>I will use jsons, but my question is:</p>

<p>assumed i use this code to send request:</p>

<pre><code>URL url = new URL("http://www.francescorizzi.altervista.org/Main.php?Request=Login&amp;UserName=mario&amp;Password=lol");
URLConnection conn = url.openConnection();

// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;

while ((line = rd.readLine()) != null) {
    System.out.println(line);
}
</code></pre>

<p>Should i recreate the url object, conn, and rd at each new request? or is there a more efficient way to do this?</p>

<p>Please note: I'm new to http handling through java.</p>