java - POST vs JDBC

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2010-06-05T05:47:19Z Indexed on 2010/06/05 6:12 UTC
Read the original article Hit count: 275

Filed under:
|
|
|
|

OK so here's the code:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
public class Main {
    public static void main(String[] args)  {
        try {
            URL my_url = new URL("http://www.viralpatel.net/blogs/");
            BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream()));
            String strTemp = "";
            while(null != (strTemp = br.readLine())){
            System.out.println(strTemp);
        }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

Using this method I can use POST and GET methods using PHP scripts. I can then use the PHP scripts to the MySQL database which in turn outputs back to the java applet. Is this possible? (and safer?)

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about php