首页> 外文期刊>Java Developer's Journal >Using JDBC & the Template Method Pattern for Database Access
【24h】

Using JDBC & the Template Method Pattern for Database Access

机译:使用JDBC和模板方法模式进行数据库访问

获取原文
获取原文并翻译 | 示例
       

摘要

JDBC is a simple and flexible way to access a relational database. The knock on JDBC is that it forces a developer to familiarize himself with its API, whose use can often result in reams of duplicate or similar code: get a connection, execute a statement, parse a result set, etc. All of which needs to be wrapped in a try-catch block and synchronized. However, in this article, I'll describe how to use the template method pattern to centralize an application's JDBC code into a single class that can be extended using a minimum of JDBC knowledge.
机译:JDBC是一种访问关系数据库的简单灵活的方法。 JDBC的缺点是,它迫使开发人员熟悉其API,使用该API通常会导致大量重复或类似的代码:获得连接,执行语句,解析结果集等。所有这些都需要包裹在try-catch块中并进行同步。但是,在本文中,我将描述如何使用模板方法模式将应用程序的JDBC代码集中到单个类中,而该类可以使用最少的JDBC知识进行扩展。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号