昨天的学习

因为过了12点才发
protected String getJsonString(String urlPath) throws Exception { 
    URL url = new URL(urlPath); 
    HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 
    connection.connect(); 
    InputStream inputStream = connection.getInputStream();  
    Reader reader = new InputStreamReader(inputStream, "UTF-8"); 
    BufferedReader bufferedReader = new BufferedReader(reader); 
    String str = null; 
    StringBuffer sb = new StringBuffer(); 
    while ((str = bufferedReader.readLine()) != null) { 
        sb.append(str); 
    } 
    reader.close(); 
    connection.disconnect(); 
    return sb.toString(); 

通过今天的学习我发现JSON都是在从数据库调取质料 但是无法用java进行修改等
只能是查询很显示通过java来调取数据库 在返回JSON的值我在这里就弄不打明白了
唯一发现能修改的的就是通过javascript还进行修改
var uptatejson=[{name:"蒋佳良"},{name:"蒋佳良"}];
uptatejson[0].name="你把我修改了";
alert(uptatejson[0].name);
比如想这样  是不是在java只能查询值呀?
今天的单词
private私有的,当前类可访问
protected 受保护的,继承可访问
default 默认的,包内可访问

猜你喜欢

转载自xjwolaile.iteye.com/blog/1630989
今日推荐