首页 | 本学科首页   官方微博 | 高级检索  
     

改进JDBC框架的研究与应用
引用本文:葛萌,欧阳宏基,陈伟.改进JDBC框架的研究与应用[J].计算机系统应用,2021,30(6):107-111.
作者姓名:葛萌  欧阳宏基  陈伟
作者单位:咸阳师范学院 计算机学院, 咸阳 712099
基金项目:咸阳师范学院“青年骨干教师”培养项目(XSYGG201615); 咸阳师范学院专项科研计划(XSYK19021, XSYK19054)
摘    要:分析了传统JDBC框架存在的代码复用性低、耦合度高、不易移植、易出现网络故障导致Connection对象失效等缺陷, 结合若干设计模式和数据库重连机制, 提出了一种改进的JDBC框架. 该框架通过DAO模式向业务逻辑层提供调用持久化逻辑的接口、解耦合业务逻辑与持久化逻辑; 利用模板、策略和工厂模式封装DAO的具体实现, 实现具体持久化代码的统一性并减少代码的冗余度. 将改进的JDBC框架应用于某高校绩效考核管理系统, 实践结果表明, 通过使用改进的JDBC框架, 有效增强了系统的鲁棒性, 解耦合了数据持久层与业务逻辑层, 提高了数据持久层代码的复用率和开发效率.

关 键 词:JDBC  设计模式  数据库重连机制  数据持久层
收稿时间:2020/9/23 0:00:00
修稿时间:2020/10/21 0:00:00

Research and Application of Improved JDBC Framework
GE Meng,OUYANG Hong-Ji,CHEN Wei.Research and Application of Improved JDBC Framework[J].Computer Systems& Applications,2021,30(6):107-111.
Authors:GE Meng  OUYANG Hong-Ji  CHEN Wei
Affiliation:School of Computer Science, Xianyang Normal University, Xianyang 712099, China
Abstract:The traditional JDBC framework is featured by low code reusability, high coupling, and difficult transplantation, with connection object failures caused by frequent network faults. In this study, we propose a novel JDBC framework combined with several design patterns and the database reconnection mechanism. Through the DAO pattern, the proposed method provides the persistence logic interface, the decouple business logic and the persistence logic to the business logic layer. The concrete implementation of DAO is encapsulated through templates, strategies and factory patterns, improving uniformity of persistence codes while reducing code redundancy. This novel framework is applied to the performance evaluation system in a university. The results demonstrate that the improved JDBC framework decouples the data persistence layer from the business logic layer and improves the reuse rate and development efficiency of the codes in the data persistence layer, enhancing the robustness of the system.
Keywords:JDBC  design pattern  database reconnection mechanism  data persistence layer
本文献已被 万方数据 等数据库收录!
点击此处可从《计算机系统应用》浏览原始摘要信息
点击此处可从《计算机系统应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号