練功房推薦書單

  • Google!Android 3手機應用程式設計入門(第四版)
  • 賈伯斯傳(軟皮精裝版)
  • 猛虎出閘制霸版:最新OCP Java SE 6 Programmer專業認證(附原始程式碼及範例檔)
  • SCWCD 5 猛虎出閘:Java Web 應用程式專業認證
用DAO4J + SQuirreL SQL Client產生Java JDBC Code  XML
Forum Index » 網頁程式設計 Web Development
Author Message
andowson

六段學員
[Avatar]

Joined: 2007-01-02 22:20:40
Messages: 652
Location: 台北
Offline

SQuirreL SQL Client下載網址:
http://squirrel-sql.sourceforge.net/#installation

DAO4J下載網址:
http://members.multimania.co.uk/dao4j/dao4j.zip

先安裝好SQuirreL SQL Client後,再將dao4j.zip解壓縮,在解開的目錄中有個dao4j-plugin.zip和plugin.pdf說明檔,把dao4j-plugin.zip解壓縮到SQuirreL SQL Client安裝目錄下的plugins目錄,再重新啟動SQuirreL SQL Client即可。

然後用SQuirreL SQL Client連接資料庫,在table或view上面按滑鼠右鍵,選擇Generate DAO,然後給定產生檔案的目錄、package name,再按下OK就開始產生了。

如果出現資料庫的資料型態不存在的錯誤而失敗的錯誤訊息時,請到SQuirreL SQL Client\plugins\dao4j\conf目錄下,修改資料庫所對應的TypeMapping definition properties檔,例如PostgreSQL就需要再加個int4=int。

參考資料
http://www.slideshare.net/junyuo/utilized-code-gen-to-save-our-efforts-in-sap-integration

分享經驗 累積智慧
[WWW] [MSN]
 
Forum Index » 網頁程式設計 Web Development
Go to: