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 閱讀(281) 評論(0)  編輯  收藏
          主站蜘蛛池模板: 从江县| 樟树市| 唐河县| 云霄县| 平乡县| 临安市| 高青县| 昭平县| 德安县| 天长市| 桓仁| 扎鲁特旗| 延庆县| 凌云县| 万安县| 陵川县| 新兴县| 晋江市| 昌宁县| 商都县| 民权县| 高州市| 宿迁市| 许昌市| 化德县| 延吉市| 合川市| 屏东县| 克东县| 泰来县| 汝阳县| 阳信县| 新宁县| 六盘水市| 刚察县| 麦盖提县| 图木舒克市| 卓尼县| 类乌齐县| 渭源县| 弋阳县|