隨筆-11  評論-0  文章-2  trackbacks-0
            2012年7月10日
          1. <%  
          2. WebApplicationContext context = (WebApplicationContext)this.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);  
          3. TestService service = (TestService)context.getBean("testService");  
          4. %> 
          posted @ 2013-08-08 14:48 邦 閱讀(205) | 評論 (0)編輯 收藏

          一、模版修改

          在導出表時,powerdesigner默認為我們提供了很多的模版,在工具欄中選擇【Report--->Report Template】即可看到所有的默認模版。如圖一:

          圖一 模版列表

          這里我們為了導出powerdesigner中創建的表,在工具欄中選擇【Report--->Reports】(快捷鍵Ctrl+E),然后創建一個New Report,如下圖二所以,選擇Standard Physical Report,這里選擇的標準的模版,點擊OK確定。

          圖二 創建新的Report

          從工具欄【Report--->Print Preview】或者點擊圖標同樣可以預覽導出到word的效果了。效果如圖三所示:

          圖三 導出到word中預覽效果

          從【圖三】中的工具欄里面HTM和RTF兩種導出格式。如果導出到word選擇RTF格式即可,但是我們從【圖三】中看出紅色標出的部分,1 是word的頁眉,同樣還有頁腳信息 ,2 是一些列的屬性清單。

                                            

          圖四 設置頁眉、頁腳

          在【圖四】中,選擇Header/Footer后,刪掉Header里面的%MODULE% %MODELNAME%,刪掉Footer里面的%APPNAME% %DATE% 頁數 %PAGE%,User_defined footer就會自動勾上,這樣就去掉了頁眉、頁腳了

           

          還有其他的比如表前面的自增序號,第一頁中的創建者、版本、日期信息也不需要,我們可以進行配置去掉,如下【圖五】【圖六】

                                          

                                                        圖四 

           

                                                        圖五 Properties配置

          在圖五中,在默認配置中(General)勾上No paragraph numbering即可取消表前面的自增序號,在Title Page中選擇 No Title Page就不會生成第一頁中關于創建者、版本、日期等信息。

          在【圖三】中,預覽看到的內容太多,就必須刪除一些我們不需要的內容,經過刪減之后,如下【圖六】所示

          圖六 

          在【圖六】中右鍵單擊【List of Table Columns - 表<%PARENT%>列說明】,從菜單中選擇 Edit Title...,就可以編輯成現在我們已看到的。然后,在右鍵菜單中選擇Layout...,選擇我們所需要顯示的內容,Code表示列名稱,一般用英文單詞或拼音字母表示,Name一般用中文描述,Data Type 表示數據類型,Comment表示字段備注或字段說明等。

          到此基本上已經完成了powerdesigner模版的修改

          二、導出表

          然后點擊[Report---->Generate RTF]導出到word中,最后我們看看導出到word的效果,如下圖:

          圖七 導出到word效果

          三、保存模版

                通過上文,我們完成了自己所需的模版,然后就保存,以后可以直接使用即可,在工具欄中[Report--->Create Template From Section],然后Ctrl+S就會要求保存,取名保存即可。

          posted @ 2012-09-24 18:12 邦 閱讀(586) | 評論 (0)編輯 收藏
           /Files/bang/Maven3應用入門講座.pptx
          posted @ 2012-08-22 10:31 邦 閱讀(263) | 評論 (0)編輯 收藏
          用jTDS通過JDBC連:
          <dependency>
          <groupId>net.sourceforge.jtds</groupId>
          <artifactId>jtds</artifactId>
          <version>1.2.4</version>
          </dependency>

          public static List<String> executeQuery(String sql,String columns) {

                  try {
                      Connection conn = getConnection();
                      Statement st = conn.createStatement();
                      ResultSet set = st.executeQuery(sql);
                      List<String> result = new ArrayList<String>();
                      while (set.next()) {
                          String[] columnList = columns.split(",");
                          for(String str:columnList){
                              result.add(set.getString(str));
                          }
                         
                      }
                      set.close();
                      st.close();
                      conn.close();
                      return result;
                  } catch (SQLException e) {
                      throw new IllegalArgumentException(e);
                  }
              }

              public static Connection getConnection() {
                  try {
                      Class.forName("net.sourceforge.jtds.jdbc.Driver");
                      String url = "jdbc:jtds:sqlserver://localhost:1433;DatabaseName=jdl";
                      String username = "sa";
                      String password = "";
                      Connection conn = DriverManager.getConnection(url, username,
                      password);
                      return conn;
                  } catch (Exception e) {
                      throw new IllegalArgumentException(e);
                  }
              }

          posted @ 2012-08-02 15:55 邦 閱讀(5154) | 評論 (0)編輯 收藏
          在js中的url進行encodeURIComponent編碼:dd_ddtj_sub.jsp?shrxm="+encodeURIComponent(shrxm1)+"&lxdh="+encodeURIComponent(lxdh1)
          后臺service進行encode編碼和decode解碼:shrxm= java.net.URLEncoder.encode(shrxm, "UTF-8");
            shrxm= java.net.URLDecoder.decode(shrxm,"UTF-8");
          posted @ 2012-07-11 17:01 邦 閱讀(278) | 評論 (0)編輯 收藏

          1)、下載MongoDB
          http://downloads.mongodb.org/win32/mongodb-win32-i386-2.0.4.zip

          2)、設置MongoDB目錄

          將其解壓到 d:\,再重命名為mongodb,路徑為d:\mongodb

          3)、設置數據文件路徑

          d:盤建一個data文件夾,在data文件夾中新建db文件夾,路徑d:\data\db

          4)、啟動MongoDB服務

          進入 cmd 提示符控制臺,
          D:\mongodb\bin\mongod.exe --dbpath=d:\data\db

          <!--[if !supportLists]-->1.  <!--[endif]-->Mon Apr 16 08:50:54
          <!--[if !supportLists]-->2.  <!--[endif]-->Mon Apr 16 08:50:54 warning: 32-bit servers don't have journaling enabled by def
          <!--[if !supportLists]-->3.  <!--[endif]-->ault. Please use --journal if you want durability.
          <!--[if !supportLists]-->4.  <!--[endif]-->Mon Apr 16 08:50:54
          <!--[if !supportLists]-->5.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] MongoDB starting : pid=5084 port=27017 dbpat
          <!--[if !supportLists]-->6.  <!--[endif]-->h=d:\data\db 32-bit host=PC-201012302214
          <!--[if !supportLists]-->7.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
          <!--[if !supportLists]-->8.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are
          <!--[if !supportLists]-->9.  <!--[endif]-->limited to about 2 gigabytes of data
          <!--[if !supportLists]-->10. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       see http://blog.mongodb.org/post/13
          <!--[if !supportLists]-->11. <!--[endif]-->7788967/32-bit-limitations
          <!--[if !supportLists]-->12. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       with --journal, the limit is lower
          <!--[if !supportLists]-->13. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
          <!--[if !supportLists]-->14. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] db version v2.0.4, pdfile version 4.5
          <!--[if !supportLists]-->15. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506
          <!--[if !supportLists]-->16. <!--[endif]-->cb21f8ebf
          <!--[if !supportLists]-->17. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] build info: windows sys.getwindowsversion(ma
          <!--[if !supportLists]-->18. <!--[endif]-->jor=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB
          <!--[if !supportLists]-->19. <!--[endif]-->_VERSION=1_42
          <!--[if !supportLists]-->20. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] options: { dbpath: "d:\data\db" }
          <!--[if !supportLists]-->21. <!--[endif]-->Mon Apr 16 08:50:54 [websvr] admin web console waiting for connections on port 2
          <!--[if !supportLists]-->22. <!--[endif]-->8017
          <!--[if !supportLists]-->23. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] waiting for connections on port 27017

          MongoDB服務端的默認連接端口:27017

          5)、將MongoDB作為 Windows 服務隨機啟動

          先創建D:\mongodb\logs\mongodb.log文件,用于存儲MongoDB的日志文件, 再安裝系統服務:
                
          D:\mongodb\bin\mongod --dbpath=d:\data\db --logpath=d:\mongodb\log

          s\mongodb.log --install   
          all output going to: d:\mongodb\logs\mongodb.log  
          Creating service MongoDB.  
          Service creation successful.  
          Service can be started from the command line via 'net start "MongoDB"'.
          D:\>net start mongodb  
          Mongo DB 
          服務已經啟動成功。  
          D:> 
          注意:如果需要卸載服務,執行命令:sc delete MongoDB

          6)、客戶端連接驗證

          新打開一個CMD輸入:d:\mongodb\bin\mongo,如果出現下面提示,那么您就可以開始MongoDB之旅了:

          <!--[if !supportLists]-->1.  <!--[endif]-->d:\mongodb\bin\mongo  
          <!--[if !supportLists]-->2.  <!--[endif]-->MongoDB shell version: 2.0.4  
          <!--[if !supportLists]-->3.  <!--[endif]-->connecting to: test  
          <!--[if !supportLists]-->4.  <!--[endif]-->> 

          7)、查看MongoDB日志

          查看D:\mongodb\logs\mongodb.log文件,即可對MongoDB的運行情況進行查看或排錯。

          posted @ 2012-07-10 13:24 邦 閱讀(639) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 阿拉善右旗| 芮城县| 岳池县| 叶城县| 利川市| 吴江市| 枞阳县| 都匀市| 法库县| 比如县| 雅安市| 红河县| 保靖县| 金寨县| 家居| 雷波县| 光泽县| 崇文区| 弥勒县| 萍乡市| 永胜县| 商丘市| 阳泉市| 济南市| 定襄县| 新乡县| 剑川县| 文化| 兴化市| 遂平县| 永登县| 翼城县| 万年县| 京山县| 新绛县| 睢宁县| 象山县| 保德县| 东乌| 拜城县| 康乐县|