SlideShare a Scribd company logo
1 of 60
Download to read offline
lwdba –  開放原始碼的輕量級資料庫存取程式庫 王建興
個人簡介 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 是什麼 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
使用複雜的 Framework 的問題 ,[object Object],[object Object],[object Object]
直接使用 JDBC 的問題 ,[object Object],[object Object]
直接以 SQL 存取資料庫的問題 ,[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 的設計目標 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Commons DbUtils: JDBC Utility Component ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 不同於 DbUtils 之處 ,[object Object],[object Object],[object Object],[object Object]
如何取得 lwdba ,[object Object],[object Object]
如何建構 lwdba ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 的設定  (1/3) ,[object Object],lwdba.pool.default.type=mysql lwdba.pool.default.driverClassName=org.gjt.mm.mysql.Driver lwdba.pool.default.driverURL=jdbc:mysql://localhost:3306/lwdba lwdba.pool.default.userName=root lwdba.pool.default.password=root lwdba.pool.default.maxConnectionCount=32 lwdba.pool.default.encoding=UTF-8 lwdba.pool.default.sqlFile=sql Pool Name
lwdba 的設定  (2/3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 的設定  (3/3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 主架構 SQLExecutorManager DBCP JDBC SQLExecutor SQLManager DBFacade DBRow 基於 lwdba 的應用程式 Database
lwdba 中的主要類別 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
lwdba 如何看待 SQL statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
在 lwdba 中得到 SQL 述句的兩種途徑 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DBRow  - 建構式  (1/2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
DBRow  - 建構式  (2/2) ,[object Object],[object Object],[object Object],[object Object]
DBRow  - 存取整個 row 值 ,[object Object],[object Object],[object Object],[object Object],[object Object]
DBRow  - 存取 column ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DBRow  - 產生 SQL 述句 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DBRow  - 產生新增資料 SQL 述句的例子 DBRow dr = new DBRow("Customer", "seqNo"); dr.setColumn("name", name); dr.setColumn("phone", phone); dr.setColumn("address", address); System.out.println(dr.toInsertString()); insert into Customer(phone, address, name) values('0988168168', 'Hsinchu City, Taiwan', 'Qing')
DBRow  - 產生刪除資料 SQL 述句的例子 ,[object Object],DBRow dr = new DBRow("Customer", "seqNo"); dr.setColumn(“seqNo", 123); System.out.println(dr.toDeleteString()); 所設定的 column 會做為 where 子句中的條件
DBRow  - 產生更新資料 SQL 述句的例子 ,[object Object],DBRow dr = new DBRow("Customer", "seqNo"); dr.setColumn(“seqNo", 123); dr.setColumn(“phone", ”0939168888”); System.out.println(dr.toUpdateString()); 只設定 PK 及欲更新的 column 即可!
DBRow  - 產生查詢資料 SQL 述句的例子 ,[object Object],DBRow dr = new DBRow("Customer", "seqNo"); dr.setColumn(“phone", ”0939168888”); System.out.println(dr.toQueryString()); 所設定的 column 會做為 where 子句中的條件
DBRow  -建構式中  databaseType 引數的作用 ,[object Object],DBRow dr = new DBRow("Customer", "seqNo", "oracle"); dr.setColumn("name", name); dr.setColumn("phone", phone); dr.setColumn("address", address); dr.setColumn("createdTime", new Date()); System.out.println(dr.toInsertString()); insert into Customer(phone, createdTime, address, name) values('0988168168', TO_DATE('2009-03-12 14:13:37', 'YYYY-MM-DD HH24:MI:SS'), 'Hsinchu City, Taiwan', 'Qing')
SQLManager ,[object Object],[object Object],[object Object],[object Object],[object Object]
SQL 述句設定檔 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQLManager 所帶來的好處 ,[object Object],[object Object],[object Object],[object Object],[object Object]
SQLManager  - 取得 SQL 述句( 1/2 ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQLManager  - 取得 SQL 述句( 2/2 ) ,[object Object],[object Object],[object Object],String sql = sqlManager.getSQL(“ User.getUserPassword”, “qing”); 自動加上單引號 User.getUserPassword=select password from UserAccount where id= {0}
DBFacade  - 何謂 Facade ,[object Object],[object Object],*Gamma et al (1995). Design Patterns: Elements of Reusable Object-Oriented Software.
DBFacade  - 用以實作資料存取的子系統 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
UserAccountFacade 的介面 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
基於子系統劃分的設計方式 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
基於 Façade 從事設計的優點 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DBFacade  -  lwdba 中所有 Façade 的基礎類別 ,[object Object],[object Object],[object Object],[object Object]
DBFacade  - 建構式 ,[object Object],[object Object],[object Object],[object Object],[object Object],lwdba.pool. default .type=mysql lwdba.pool. default .driverClassName=org.gjt.mm.mysql.Driver lwdba.pool. default .driverURL=jdbc:mysql://localhost:3306/lwdba … . lwdba.pool. default .sqlFile=sql
DBFacade  - 進行查詢,回傳 QueryResult ,[object Object],[object Object],[object Object],[object Object]
QueryResult  - 用來表示一組查詢結果 ,[object Object],[object Object],[object Object],[object Object],[object Object]
DBFacade  - 進行查詢,回傳 ArrayList ,[object Object],[object Object],[object Object],[object Object]
取得查詢結果 ,[object Object],[object Object],[object Object],[object Object],[object Object]
取得查詢結果 - 範例 StatisticsFacade facade = StatisticsFacade.getInstance(); ArrayList al = PPTVStatisticsFacade.listStatistics(n); <% for(int i=0;i<al.size();i++) { HashMap hm = (HashMap) al.get(i); %> <tr> <td><%=hm.get(&quot;seqNo&quot;)%></td> <td><%=hm.get(&quot;uid&quot;)%></td> <td><%=hm.get(&quot;remoteHost&quot;)%></td> <td><%=hm.get(&quot;type&quot;)%></td> <td><%=hm.get(&quot;createTime&quot;)%></td> </tr> <% } %>
DBFacade  - 更新資料 ,[object Object],[object Object],[object Object]
如何使用 DBFacade ,[object Object],[object Object],[object Object],[object Object]
處理交易 -  TransSQLExecutor ,[object Object],[object Object],[object Object]
TransSQLExecutor 與 SQLExecutor 的差異處 ,[object Object],[object Object],[object Object]
TransSQLExecutor  - 支援交易 ,[object Object],[object Object],[object Object],[object Object]
TransSQLExecutor  -處理交易的例子 TransSQLExecutor tse = new TransSQLExecutor(); DBRow dr = new DBRow(&quot;Customer&quot;, &quot;seqNo&quot;); dr.setColumn(&quot;name&quot;, “Alice&quot;); dr.setColumn(&quot;phone&quot;, &quot;0988168168&quot;); dr.setColumn(&quot;address&quot;, &quot;Hsinchu City, Taiwan&quot;); tse.executeUpdate(dr.toInsertString()); tse.rollback(); dr = new DBRow(&quot;Customer&quot;, &quot;seqNo&quot;); dr.setColumn(&quot;name&quot;, “Bob&quot;); dr.setColumn(&quot;phone&quot;, &quot;0968168168&quot;); dr.setColumn(&quot;address&quot;, &quot;Hsinchu City, Taiwan&quot;); tse.executeUpdate(dr.toInsertString()); tse.commit(); tse.close();
SQL 查詢結果的快取 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
memcached ,[object Object],[object Object],[object Object],[object Object],[object Object]
取得並設置 memcached ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL 查詢結果的快取 -  CachedQueryFacade ,[object Object],[object Object],[object Object],[object Object]
CachedQueryFacade  - 快取的失效與刷新 ,[object Object],[object Object],[object Object],[object Object]
使用 lwdba 於你的資料庫存取 ,[object Object],[object Object],[object Object],[object Object],[object Object]
歡迎參加 lwdba 專案或提供各種建議及指教! qing at cs.nthu.edu.tw
[object Object],[object Object],[object Object],Thank You

More Related Content

What's hot

RockStor - A Cloud Object System based on Hadoop
RockStor -  A Cloud Object System based on HadoopRockStor -  A Cloud Object System based on Hadoop
RockStor - A Cloud Object System based on HadoopSchubert Zhang
 
Struts学习笔记
Struts学习笔记Struts学习笔记
Struts学习笔记yiditushe
 
深入学习Mongo db
深入学习Mongo db深入学习Mongo db
深入学习Mongo dbLucien Li
 
iOS程序设计-数据持久化
iOS程序设计-数据持久化iOS程序设计-数据持久化
iOS程序设计-数据持久化qiyutan
 
第10章 权限管理
第10章 权限管理第10章 权限管理
第10章 权限管理zhang shuren
 
How to Build Cloud Storage Service Systems
How to Build Cloud Storage Service SystemsHow to Build Cloud Storage Service Systems
How to Build Cloud Storage Service SystemsHanborq Inc.
 
Ibm web sphere_portal_v6_安装指南
Ibm web sphere_portal_v6_安装指南Ibm web sphere_portal_v6_安装指南
Ibm web sphere_portal_v6_安装指南mycoolmen1987
 
手机之家的数据访问层实践
手机之家的数据访问层实践手机之家的数据访问层实践
手机之家的数据访问层实践guestf5121c
 
百度分布式数据实践与进展
百度分布式数据实践与进展百度分布式数据实践与进展
百度分布式数据实践与进展yp_fangdong
 
Hibernate的高级操作
Hibernate的高级操作Hibernate的高级操作
Hibernate的高级操作yiditushe
 
網站設計100步
網站設計100步網站設計100步
網站設計100步evercislide
 

What's hot (15)

Hibernate
HibernateHibernate
Hibernate
 
SCJP ch09
SCJP ch09SCJP ch09
SCJP ch09
 
第11章
第11章 第11章
第11章
 
Java物件導向
Java物件導向Java物件導向
Java物件導向
 
RockStor - A Cloud Object System based on Hadoop
RockStor -  A Cloud Object System based on HadoopRockStor -  A Cloud Object System based on Hadoop
RockStor - A Cloud Object System based on Hadoop
 
Struts学习笔记
Struts学习笔记Struts学习笔记
Struts学习笔记
 
深入学习Mongo db
深入学习Mongo db深入学习Mongo db
深入学习Mongo db
 
iOS程序设计-数据持久化
iOS程序设计-数据持久化iOS程序设计-数据持久化
iOS程序设计-数据持久化
 
第10章 权限管理
第10章 权限管理第10章 权限管理
第10章 权限管理
 
How to Build Cloud Storage Service Systems
How to Build Cloud Storage Service SystemsHow to Build Cloud Storage Service Systems
How to Build Cloud Storage Service Systems
 
Ibm web sphere_portal_v6_安装指南
Ibm web sphere_portal_v6_安装指南Ibm web sphere_portal_v6_安装指南
Ibm web sphere_portal_v6_安装指南
 
手机之家的数据访问层实践
手机之家的数据访问层实践手机之家的数据访问层实践
手机之家的数据访问层实践
 
百度分布式数据实践与进展
百度分布式数据实践与进展百度分布式数据实践与进展
百度分布式数据实践与进展
 
Hibernate的高级操作
Hibernate的高级操作Hibernate的高级操作
Hibernate的高级操作
 
網站設計100步
網站設計100步網站設計100步
網站設計100步
 

Viewers also liked

開放原始碼的回收與再利用
開放原始碼的回收與再利用開放原始碼的回收與再利用
開放原始碼的回收與再利用建興 王
 
開發實用創新的 Android 應用程式
開發實用創新的 Android 應用程式開發實用創新的 Android 應用程式
開發實用創新的 Android 應用程式建興 王
 
認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算建興 王
 
IKVM.NET 深入敵營的 Java
IKVM.NET 深入敵營的 JavaIKVM.NET 深入敵營的 Java
IKVM.NET 深入敵營的 Java建興 王
 
在雲端上啜飲爪哇
在雲端上啜飲爪哇在雲端上啜飲爪哇
在雲端上啜飲爪哇建興 王
 
Java 的開放原碼全文搜尋技術 - Lucene
Java 的開放原碼全文搜尋技術 - LuceneJava 的開放原碼全文搜尋技術 - Lucene
Java 的開放原碼全文搜尋技術 - Lucene建興 王
 
Introduction to C++ over CLI
Introduction to C++ over CLIIntroduction to C++ over CLI
Introduction to C++ over CLI建興 王
 
從 Java programmer 的觀點看 ruby
從 Java programmer 的觀點看 ruby從 Java programmer 的觀點看 ruby
從 Java programmer 的觀點看 ruby建興 王
 
「沙中撈金術」﹣談開放原始碼的推薦系統
「沙中撈金術」﹣談開放原始碼的推薦系統 「沙中撈金術」﹣談開放原始碼的推薦系統
「沙中撈金術」﹣談開放原始碼的推薦系統 建興 王
 
全文搜尋引擎的進階實作與應用
全文搜尋引擎的進階實作與應用全文搜尋引擎的進階實作與應用
全文搜尋引擎的進階實作與應用建興 王
 

Viewers also liked (10)

開放原始碼的回收與再利用
開放原始碼的回收與再利用開放原始碼的回收與再利用
開放原始碼的回收與再利用
 
開發實用創新的 Android 應用程式
開發實用創新的 Android 應用程式開發實用創新的 Android 應用程式
開發實用創新的 Android 應用程式
 
認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算
 
IKVM.NET 深入敵營的 Java
IKVM.NET 深入敵營的 JavaIKVM.NET 深入敵營的 Java
IKVM.NET 深入敵營的 Java
 
在雲端上啜飲爪哇
在雲端上啜飲爪哇在雲端上啜飲爪哇
在雲端上啜飲爪哇
 
Java 的開放原碼全文搜尋技術 - Lucene
Java 的開放原碼全文搜尋技術 - LuceneJava 的開放原碼全文搜尋技術 - Lucene
Java 的開放原碼全文搜尋技術 - Lucene
 
Introduction to C++ over CLI
Introduction to C++ over CLIIntroduction to C++ over CLI
Introduction to C++ over CLI
 
從 Java programmer 的觀點看 ruby
從 Java programmer 的觀點看 ruby從 Java programmer 的觀點看 ruby
從 Java programmer 的觀點看 ruby
 
「沙中撈金術」﹣談開放原始碼的推薦系統
「沙中撈金術」﹣談開放原始碼的推薦系統 「沙中撈金術」﹣談開放原始碼的推薦系統
「沙中撈金術」﹣談開放原始碼的推薦系統
 
全文搜尋引擎的進階實作與應用
全文搜尋引擎的進階實作與應用全文搜尋引擎的進階實作與應用
全文搜尋引擎的進階實作與應用
 

Similar to lwdba – 開放原始碼的輕量級資料庫存取程式庫

山頂洞人日記 - 回歸到最純樸的開發
山頂洞人日記 -  回歸到最純樸的開發山頂洞人日記 -  回歸到最純樸的開發
山頂洞人日記 - 回歸到最純樸的開發koji lin
 
Essential oracle security internal for dba
Essential oracle security internal for dbaEssential oracle security internal for dba
Essential oracle security internal for dbamaclean liu
 
Sql Alchemy Story
Sql Alchemy StorySql Alchemy Story
Sql Alchemy StoryZoom Quiet
 
3 hibernate映射元素和类型
3 hibernate映射元素和类型3 hibernate映射元素和类型
3 hibernate映射元素和类型Zelin Wang
 
Oracle北大青鸟完全教程
Oracle北大青鸟完全教程Oracle北大青鸟完全教程
Oracle北大青鸟完全教程yiditushe
 
mysql总结
mysql总结mysql总结
mysql总结haiwang
 
Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫
Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫
Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫Justin Lin
 
Huangjing renren
Huangjing renrenHuangjing renren
Huangjing renrend0nn9n
 
数据库性能诊断的七种武器
数据库性能诊断的七种武器数据库性能诊断的七种武器
数据库性能诊断的七种武器Leyi (Kamus) Zhang
 
用JAX-RS和Jersey完成RESTful Web Services
用JAX-RS和Jersey完成RESTful Web Services用JAX-RS和Jersey完成RESTful Web Services
用JAX-RS和Jersey完成RESTful Web Servicesjavatwo2011
 
My sql管理基础 李春_v2
My sql管理基础 李春_v2My sql管理基础 李春_v2
My sql管理基础 李春_v2Pickup Li
 
Java SE 8 技術手冊第 16 章 - 整合資料庫
Java SE 8 技術手冊第 16 章 - 整合資料庫Java SE 8 技術手冊第 16 章 - 整合資料庫
Java SE 8 技術手冊第 16 章 - 整合資料庫Justin Lin
 
在Windows azure平台上進行資料庫處理及架構設計
在Windows azure平台上進行資料庫處理及架構設計在Windows azure平台上進行資料庫處理及架構設計
在Windows azure平台上進行資料庫處理及架構設計Sky Chang
 
Spring 2.x 中文
Spring 2.x 中文Spring 2.x 中文
Spring 2.x 中文Guo Albert
 
第一讲 My sql初步
第一讲 My sql初步第一讲 My sql初步
第一讲 My sql初步hjl888666
 
Ibatis技术讲座
Ibatis技术讲座Ibatis技术讲座
Ibatis技术讲座xujie
 
Postgre sql intro 0
Postgre sql intro 0Postgre sql intro 0
Postgre sql intro 0March Liu
 
如何架构和开发高性能,高伸缩性Web 应用系统
如何架构和开发高性能,高伸缩性Web 应用系统如何架构和开发高性能,高伸缩性Web 应用系统
如何架构和开发高性能,高伸缩性Web 应用系统melity78
 
淘宝网架构变迁和挑战(Oracle架构师日)
淘宝网架构变迁和挑战(Oracle架构师日)淘宝网架构变迁和挑战(Oracle架构师日)
淘宝网架构变迁和挑战(Oracle架构师日)vanadies10
 

Similar to lwdba – 開放原始碼的輕量級資料庫存取程式庫 (20)

山頂洞人日記 - 回歸到最純樸的開發
山頂洞人日記 -  回歸到最純樸的開發山頂洞人日記 -  回歸到最純樸的開發
山頂洞人日記 - 回歸到最純樸的開發
 
Essential oracle security internal for dba
Essential oracle security internal for dbaEssential oracle security internal for dba
Essential oracle security internal for dba
 
Sql Alchemy Story
Sql Alchemy StorySql Alchemy Story
Sql Alchemy Story
 
3 hibernate映射元素和类型
3 hibernate映射元素和类型3 hibernate映射元素和类型
3 hibernate映射元素和类型
 
Oracle北大青鸟完全教程
Oracle北大青鸟完全教程Oracle北大青鸟完全教程
Oracle北大青鸟完全教程
 
mysql总结
mysql总结mysql总结
mysql总结
 
Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫
Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫
Servlet & JSP 教學手冊第二版 - 第 9 章:整合資料庫
 
Huangjing renren
Huangjing renrenHuangjing renren
Huangjing renren
 
数据库性能诊断的七种武器
数据库性能诊断的七种武器数据库性能诊断的七种武器
数据库性能诊断的七种武器
 
Structs2簡介
Structs2簡介 Structs2簡介
Structs2簡介
 
用JAX-RS和Jersey完成RESTful Web Services
用JAX-RS和Jersey完成RESTful Web Services用JAX-RS和Jersey完成RESTful Web Services
用JAX-RS和Jersey完成RESTful Web Services
 
My sql管理基础 李春_v2
My sql管理基础 李春_v2My sql管理基础 李春_v2
My sql管理基础 李春_v2
 
Java SE 8 技術手冊第 16 章 - 整合資料庫
Java SE 8 技術手冊第 16 章 - 整合資料庫Java SE 8 技術手冊第 16 章 - 整合資料庫
Java SE 8 技術手冊第 16 章 - 整合資料庫
 
在Windows azure平台上進行資料庫處理及架構設計
在Windows azure平台上進行資料庫處理及架構設計在Windows azure平台上進行資料庫處理及架構設計
在Windows azure平台上進行資料庫處理及架構設計
 
Spring 2.x 中文
Spring 2.x 中文Spring 2.x 中文
Spring 2.x 中文
 
第一讲 My sql初步
第一讲 My sql初步第一讲 My sql初步
第一讲 My sql初步
 
Ibatis技术讲座
Ibatis技术讲座Ibatis技术讲座
Ibatis技术讲座
 
Postgre sql intro 0
Postgre sql intro 0Postgre sql intro 0
Postgre sql intro 0
 
如何架构和开发高性能,高伸缩性Web 应用系统
如何架构和开发高性能,高伸缩性Web 应用系统如何架构和开发高性能,高伸缩性Web 应用系统
如何架构和开发高性能,高伸缩性Web 应用系统
 
淘宝网架构变迁和挑战(Oracle架构师日)
淘宝网架构变迁和挑战(Oracle架构师日)淘宝网架构变迁和挑战(Oracle架构师日)
淘宝网架构变迁和挑战(Oracle架构师日)
 

Recently uploaded

20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLP20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLPJamie (Taka) Wang
 
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】黑客 接单【TG/微信qoqoqdqd】
 
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptxNCU MCL
 
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptxSymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptxNCU MCL
 
20170104 - transaction_pattern
20170104 - transaction_pattern20170104 - transaction_pattern
20170104 - transaction_patternJamie (Taka) Wang
 
20161220 - domain-driven design
20161220 - domain-driven design20161220 - domain-driven design
20161220 - domain-driven designJamie (Taka) Wang
 
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptxSymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptxNCU MCL
 
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptxNCU MCL
 
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptxNCU MCL
 
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptxNCU MCL
 

Recently uploaded (15)

20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLP20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLP
 
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
买假和真英国驾驶执照买了假的英国驾照,那跟真的有什么区别吗?买假和真正的澳大利亚驾驶执照【微信qoqoqdqd】
 
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
函數畫圖_習題5.pptx 函數畫圖_習題5.pptx 函數畫圖_習題5.pptx
 
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptxSymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
SymPy 在微積分上的應用_4.pptx SymPy 在微積分上的應用_4.pptx
 
20170104 - transaction_pattern
20170104 - transaction_pattern20170104 - transaction_pattern
20170104 - transaction_pattern
 
Entities in DCPS (DDS)
Entities in DCPS (DDS)Entities in DCPS (DDS)
Entities in DCPS (DDS)
 
20151111 - IoT Sync Up
20151111 - IoT Sync Up20151111 - IoT Sync Up
20151111 - IoT Sync Up
 
20200323 - AI Intro
20200323 - AI Intro20200323 - AI Intro
20200323 - AI Intro
 
20161220 - domain-driven design
20161220 - domain-driven design20161220 - domain-driven design
20161220 - domain-driven design
 
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptxSymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
SymPy 在微積分上的應用_5.pptx SymPy 在微積分上的應用_5.pptx
 
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
函數微分_習題4.pptx 函數微分_習題4.pptx 函數微分_習題4.pptx
 
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
函數畫圖_習題7.pptx 函數畫圖_習題7.pptx 函數畫圖_習題7.pptx
 
20200226 - AI Overview
20200226 - AI Overview20200226 - AI Overview
20200226 - AI Overview
 
20161027 - edge part2
20161027 - edge part220161027 - edge part2
20161027 - edge part2
 
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
函數畫圖_習題6.pptx 函數畫圖_習題6.pptx 函數畫圖_習題6.pptx
 

lwdba – 開放原始碼的輕量級資料庫存取程式庫

  • 1. lwdba – 開放原始碼的輕量級資料庫存取程式庫 王建興
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. lwdba 主架構 SQLExecutorManager DBCP JDBC SQLExecutor SQLManager DBFacade DBRow 基於 lwdba 的應用程式 Database
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. DBRow - 產生新增資料 SQL 述句的例子 DBRow dr = new DBRow(&quot;Customer&quot;, &quot;seqNo&quot;); dr.setColumn(&quot;name&quot;, name); dr.setColumn(&quot;phone&quot;, phone); dr.setColumn(&quot;address&quot;, address); System.out.println(dr.toInsertString()); insert into Customer(phone, address, name) values('0988168168', 'Hsinchu City, Taiwan', 'Qing')
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. 取得查詢結果 - 範例 StatisticsFacade facade = StatisticsFacade.getInstance(); ArrayList al = PPTVStatisticsFacade.listStatistics(n); <% for(int i=0;i<al.size();i++) { HashMap hm = (HashMap) al.get(i); %> <tr> <td><%=hm.get(&quot;seqNo&quot;)%></td> <td><%=hm.get(&quot;uid&quot;)%></td> <td><%=hm.get(&quot;remoteHost&quot;)%></td> <td><%=hm.get(&quot;type&quot;)%></td> <td><%=hm.get(&quot;createTime&quot;)%></td> </tr> <% } %>
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. TransSQLExecutor -處理交易的例子 TransSQLExecutor tse = new TransSQLExecutor(); DBRow dr = new DBRow(&quot;Customer&quot;, &quot;seqNo&quot;); dr.setColumn(&quot;name&quot;, “Alice&quot;); dr.setColumn(&quot;phone&quot;, &quot;0988168168&quot;); dr.setColumn(&quot;address&quot;, &quot;Hsinchu City, Taiwan&quot;); tse.executeUpdate(dr.toInsertString()); tse.rollback(); dr = new DBRow(&quot;Customer&quot;, &quot;seqNo&quot;); dr.setColumn(&quot;name&quot;, “Bob&quot;); dr.setColumn(&quot;phone&quot;, &quot;0968168168&quot;); dr.setColumn(&quot;address&quot;, &quot;Hsinchu City, Taiwan&quot;); tse.executeUpdate(dr.toInsertString()); tse.commit(); tse.close();
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 60.

Editor's Notes

  1. lwdba 不是要做一個無所不斬的寶劍 , 它有它設定的目標 , 以及要滿足的對象 在現存的程式庫中 , 和 lwdba 都以輕量級為目標的 , 應該就是 Commons 的 DbUtils