如何在Spring/Tomcat中完全禁用JDBC连接池? [英] How to completely disable JDBC Connection Pooling in Spring / Tomcat?

查看:159
本文介绍了如何在Spring/Tomcat中完全禁用JDBC连接池?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Data Source bean配置JDBC连接.

I'm using a Spring Data Source bean to configure a JDBC connection.

让此方法返回裸露的,未池化的/非托管的JDBC连接的最简单方法是什么?

What's the easiest way to have this return a bare, unpooled / unmanaged JDBC connection?

推荐答案

我认为您正在寻找org.springframework.jdbc.datasource.SimpleDriverDataSource此类是javax.sql.DataSource的非常简单的实现,并且不实现连接池,而是始终返回一个新的连接.

I think you are looking for org.springframework.jdbc.datasource.SimpleDriverDataSource this class is a very simple implementation of javax.sql.DataSource and doesn't implement connection pooling, instead it always returns a new connection.

您可以找到源代码 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆