Oracle语句:图片的读取
int time=Integer.parseInt(request.getParameter("time"));int id=Integer.parseInt(request.getParameter("id"));String imgPath= Common.getPropertiesValue("LOCAL_HOST")+"/"+ Common.getPropertiesValue("LOCAL_MANAGEROOT")+"/"+Common.getPropertiesValue("LOCAL_NEWS");Connection connl = null;PreparedStatement psl = null;ResultSet rsl = null;int shi=0;String tuanname=null;String endtime=null;try {connl = DBClassLocal.getConnection();String sqll = "select * from local_news t,local_newsimages k where t.id=k.newsid and t.id=? ";psl = connl.prepareStatement(sqll);psl.setInt(1,id);rsl=psl.executeQuery();while(rsl.next()){endtime=rsl.getString("comefrom");String path=rsl.getString("imagesname");String path2= imgPath+path;out.println("<img src='"+path2+"'/>");out.println("<br/>");}String sql = "select * from HD_AXIUTUAN where id=? ";psl = connl.prepareStatement(sql);psl.setInt(1,time);rsl=psl.executeQuery();while(rsl.next()){tuanname=rsl.getString("tuanname");out.println(tuanname);shi=rsl.getInt("shi");int tuan=rsl.getInt("tuan");out.println("<br/>");out.println("市场价:"+shi+"/斤");out.println("<br/>");out.println("团购价:"+tuan+"/斤");out.println("<br/>");}out.println(endtime);} catch (Exception e) {e.printStackTrace();} finally {if (rsl != null) {rsl.close();}if (psl != null) {psl.close();}if (connl != null) {connl.close();}}