Sun River
          Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
          posts - 78,comments - 0,trackbacks - 0
          1. How do i find whether a parameter exists in the request object?(JSP)
          A:?? boolean hasPara=request.getParameterMap().contains(theParameter);
          ???? or boolean hasfoo=!(request.getParameter("foo")==null || request.getParameter("foo").equals(""))
          2. What is 2 phase commit?
          ?A:?It is?an algorithm used to ensure the integrity of a committing transaction.?In Phase 1, the transaction coordinator contacts potential participants in the transaction, the participants all agree to make the results of the transaction permanent but?do not do so immediately. The participants log information to disk to ensure they can complete in phase 2. if all the participants agree to commit, the coordinator logs that agreement and the outcome is decided. The recording of this agreement in the log ends in?Phase 2, thecoordinator?informs each participant of the decision, and they permanently update their resources.
          3. How?Can?I insert images into a MySql Database?
          ?A:???
          ?????????? File file=new File(fPic);
          ?????????? FileInputStream fis=new FileInputStream(file);
          ?????????? PreparedStatement ps=con.prepareStatement("insert into dbPic values(?,?)");??
          ?????????? ps.setString(1,file.getName());
          ?????????? ps.setBinaryStream(2,fis,(int)file.length());
          ?????????? ps.executeUpdate();
          ?????????? ps.close();
          ?????????? fis.close();
          posted on 2006-09-25 06:43 Sun River 閱讀(283) 評論(0)  編輯  收藏
          主站蜘蛛池模板: 康平县| 紫云| 忻州市| 东城区| 达拉特旗| 确山县| 清苑县| 龙游县| 和硕县| 双鸭山市| 安化县| 增城市| 略阳县| 香格里拉县| 冷水江市| 德兴市| 兰考县| 辽阳市| 土默特左旗| 西华县| 成安县| 巴中市| 修水县| 台北县| 榆林市| 上犹县| 边坝县| 喀喇沁旗| 镇康县| 呼玛县| 洪雅县| 麦盖提县| 滨海县| 黄陵县| 和顺县| 梅河口市| 清涧县| 英吉沙县| 斗六市| 财经| 秦皇岛市|