章亞
摘要:考慮使用數據集組件來連接數據庫并操作數據庫表中數據在軟件開發中的方便性,其具有強大的數據操作能力,在很多開發環境中都提供了相應的數據集組件,但在JAVA語言的開發環境中沒有與之對應的數據集組件,一般采用JDBC接口或者OR映射的方式完成數據的操作,其中JDBC接口因其屬于較低層次接口需要大量的編程,而OR映射在涉及復雜數據關系及大量數據訪問是容易出現性能問題,在借鑒其他環境中數據集的設計理念的基礎上,以實際開發要求為目標,設計一種基于JDBC封裝的JAVA通用數據集數據訪問框架。
關鍵詞:數據集;數據集組件; 數據訪問;數據訪問框架;JAVA語言
中圖分類號:TP311.1 文獻標識碼:A 文章編號:1009-3044(2014)33-7895-07
Abstract: Consider the convenience in software development of using a dataset component to connect to the database and manipulate data in a database table, it has a powerful data manipulation capabilities, it has provided corresponding data set components in many development environment, but in the development of JAVA language environment, there is no corresponding data set components, it generally used the JDBC interface or a way to complete the operation by OR mapping data, but the JDBC interface belong to the lower level, and requires a lot of programming; The OR mapping method will prone to performance issues while involves complex data relationships and a lot of data access. On the basis of the experience of other environmental data set and on the design concept to the actual development of requirements for the goals, designed a JAVA common data set framework for JDBC-based data access package.
Key words: dataset; dataset component; data access; data access framework; JAVA languag
1 概述
軟件開發中,數據庫往往是信息系統的基石,即便是最簡單的信息系統中都會涉及到數據的持久性和數據的訪問。而JAVA作為一種可以撰寫跨平臺應用軟件的面向對象的程序設計語言,被廣泛的應用與當前的各種信息系統開發。但對于用Delphi及.Net開發過應用系統的開發人員大多都使用過數據集組件來連接數據庫并操作數據庫表數據的功能。這些功能使用很方便,同時有強大的數據操縱能力,可以對各種數據庫進行統一操縱,數據組件會根據不同數據庫的語法要求自動生成新增(insert)、修改(update)及刪除(delete)等DML語句對數據庫記錄進行操縱。在JAVA環境中沒有與之對應的數據集組件,JAVA主要依靠JDBC接口[1]來操作數據庫數據,但JDBC屬于一個較低層次的接口,雖然功能強大但需要較多的編程量,所以使用并不方便。……