數(shù)據(jù)加載中……
          我的成長(zhǎng)

          1.得到相對(duì)路徑
           URL url = ServiceFactory.class.getResource("/config/log4j.properties");

                 Properties properties = new Properties();

                 try {

                     properties.load(new InputStreamReader(url.openStream()));

                 } catch (IOException e) {

                     // TODO Auto-generated catch block

                     e.printStackTrace();

                 }

                 PropertyConfigurator.configure(properties);
          2 簡(jiǎn)單數(shù)據(jù)庫(kù)連接池使用:

           1.加入要用到的數(shù)據(jù)庫(kù)包:mysql-connector-java-3.1.13-bin.jar

           2.加入proxool-cglib.jar,proxool-0.9.1.jar和commong-logging-1.1.jar

           3.加入如下代碼:

            PropertyConfigurator.configure("src/Proxool.properties");(只在加載時(shí)使用一次)

            Connection connection = DriverManager.getConnection("proxool.proxool-sipity");(獲得連接)
           
          3.IntelliJ一款java 編譯工具(才知道)

          4.JAVA字符串轉(zhuǎn)日期或日期轉(zhuǎn)字符串
           
              SimpleDateFormat sdf =   new SimpleDateFormat( " yyyy-MM-dd HH:mm:ss " );
           
            1.字符串轉(zhuǎn)日期

             2008-07-10 19:20:00 要把它轉(zhuǎn)成日期,可以用 Date date = sdf.parse( " 2008-07-10 19:20:00 " );

            2.日期轉(zhuǎn)字符串

             String str = sdf.format(new Date());字符串內(nèi)容的格式類似2008-07-10 19:20:00。

           SimpleDateFormat sdf = new SimpleDateFormat( " yyyy年MM月dd日 " );

              String str = sdf.format(new Date());
          5使用JSP大約有下列三種跳轉(zhuǎn)方式:
           1. response.sendRedirect();
           2. response.setHeader("Location","");
           3. <jsp:forward page="" />
          5.JfreeChart使用:http://www.itpub.net/archiver/tid-628960.html

          posted on 2009-08-24 12:25 mingruofei 閱讀(184) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 保靖县| 玉林市| 伊宁县| 宁强县| 洛浦县| 襄城县| 维西| 扶余县| 正阳县| 习水县| 滦南县| 吉林省| 平阳县| 武冈市| 富蕴县| 屯门区| 托克逊县| 定兴县| 微博| 青龙| 玛沁县| 昭觉县| 句容市| 丰镇市| 澄江县| 宜阳县| 台南县| 茶陵县| 山阴县| 兴安县| 巴彦淖尔市| 马边| 阳谷县| 台中市| 图们市| 安西县| 昌平区| 安庆市| 定陶县| 罗江县| 巴青县|