數據加載中……
          我的成長

          1.得到相對路徑
           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 簡單數據庫連接池使用:

           1.加入要用到的數據庫包: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");(只在加載時使用一次)

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

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

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

            2.日期轉字符串

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

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

              String str = sdf.format(new Date());
          5使用JSP大約有下列三種跳轉方式:
           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 閱讀(179) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 通山县| 资源县| 响水县| 南康市| 正镶白旗| 元朗区| 松溪县| 和平县| 庆元县| 防城港市| 中西区| 隆子县| 宾川县| 汉寿县| 兴安县| 永州市| 平江县| 南京市| 外汇| 曲松县| 镇平县| 稷山县| 永靖县| 武冈市| 包头市| 花莲市| 仙桃市| 和田市| 嘉定区| 班戈县| 多伦县| 凤阳县| 贵德县| 安远县| 安化县| 平远县| 湘阴县| 仁化县| 广汉市| 衡东县| 开平市|