池化技术在数据库连接中的应用与实现  

Application and implementation of pooling techniques in database connections

在线阅读下载全文

作  者:杨禧 兰全祥 Yang Xi;Lan Quanxiang(School of Mathematics and Computer Science,Panzhihua University,Panzhihua 617000,China)

机构地区:[1]攀枝花学院数学与计算机学院,攀枝花617000

出  处:《现代计算机》2024年第18期83-88,共6页Modern Computer

基  金:四川省创新创业教育示范课程建设项目(Sxsxx2002-2021);2024年大学生创新创业训练计划项目(2024cxcy159)。

摘  要:随着应用系统的不断发展,数据库连接的高效管理成为确保系统性能的关键因素之一。探讨池化技术在数据库连接中的应用,通过对数据库连接池的工作原理、核心功能的研究,手动实现了基于线程安全的数据库连接池。采用properties文件来配置数据库连接池参数,使用Vector来实现连接池的空闲连接集合和已用连接集合,使用Thread⁃Local与超时等待机制来优化连接获取,通过控制最大空闲连接数来提高资源利用率。通过验证,所实现数据库连接池可行,能够对数据库连接进行管理,并能够提高数据库性能和资源利用率。With the continuous development of application systems,efficient management of database connections has become a key factor in ensuring system performance.This paper explores the application of pooling techniques in database connections.Through the study of the working principles and core functions of database connection pools,a manually implemented thread‑safe database connection pool is presented.Database connection pool parameters are configured using properties files,and Vector is utilized to manage collections of idle and used connections within the pool.ThreadLocal and timeout waiting mechanisms are employed to optimize connection acquisition,while controlling the maximum number of idle connections enhances resource utilization.Validation results confirm the feasibility of the implemented database connection pool,demonstrating its ability to manage database connections and improve both database performance and resource utilization.

关 键 词:池化技术 数据库连接池 线程安全 VECTOR 

分 类 号:TP311.13[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象