DriverManager

The basic service for managing a set of JDBC drivers.

- ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ฑ๋ก๋ DB ๋๋ผ์ด๋ฒ๋ค์ ๊ด๋ฆฌํ๊ณ , ์ปค๋ฅ์ ์ ํ๋ํ๋ ๊ธฐ๋ฅ์ ์ ๊ณต
ConnectionPool (Object Pool ํจํด)
์ปค๋ฅ์
ํ ์ฌ์ฉ ์ (๊นก DriverManager ๋ง ํ์ฉ)
- ๋งค ์์ฒญ ๋ง๋ค ์ปค๋ฅ์ ์ ์๋ก ์์ฑ, ์ข ๋ฃ
- ์ปค๋ฅ์ ์ ์์ฑํ๋ ๋ฆฌ์์ค๋ ๋งค์ฐ ๋น์ธ๋ค
- TCP/IP ์ฐ๊ฒฐ

์ปค๋ฅ์
ํ ๋์
- ์๋น์ค๋ฅผ ์์ํ๋ ์์ ์ ์ปค๋ฅ์ ๊ฐ์ฒด๋ฅผ ํ์ํ ๋งํผ ๋ฏธ๋ฆฌ ์์ฑํ์ฌ ํ์ ๋ณด๊ด
- ์ ํ๋ฆฌ์ผ์ด์ ๋ก์ง์ ์ปค๋ฅ์ ์ ์ฌ์ฉํ๋ฉด ์ข ๋ฃ ์ํค๋ ๊ฒ์ด ์๋๋ผ ์ปค๋ฅ์ ํ์ ๋ฐํํจ
- e.g.)
commons-dbcp2
,tomcat-jdbc pool
,HicariCP
See Also)
DataSource
- ์๋ฐ ํ์ค ์ปค๋ฅ์ ํ ์ธํฐํ์ด์ค
A factory for connections to the physical data source that this DataSource object represents. An alternative to the DriverManager facility, a DataSource object is the preferred means of getting a connection. -java.sql.DataSource
javadoc
NOTE
: Thejavax.sql.DataSource
interface, provides another way to connect to a data source. The use of a DataSource object is the preferred means of connecting to a data source. -java.sql.DriverManager
javadoc
DriverManager
์์ ์ง์ , ํน์HicariCP
์ ๊ฐ์ ์ปค๋ฅ์ ํ์์Connection
์ ํ๋ํ๋ ๋ฐฉ๋ฒ์ ๋ํ Facade

HikariDataSource
- HikariCP์ DataSource ๊ตฌํ์ฒด
private final HikariPool fastPathPool;
- HikariPool์ Wrapping ํจ
- ์ค์ Connection์
HikariPool.connectionBag
์ ๋ณด๊ดํจ - ๋์์ฑ ์ฒ๋ฆฌ๋ฑ์ ํธ์ ์ ๊ณต
DriverManagerDataSource
- spring์ด ์ ๊ณตํ๋
drivermanager
๋ฅผ ์ง์ datasource๋ก wrapping ํdatasource
๊ตฌํ์ฒด - ๋๋ถ์
drivermanager
๋ฅผ ์ฌ์ฉํ ๋๋ ์ปค๋ฅ์ ํ์ ์ฌ์ฉํ๋ ๊ฒ๊ณผ ๊ฐ์ ์ธํฐํ์ด์ค (datasource
)๋ฅผ ์ฌ์ฉํ ์ ์๋ค. (ํ๋ง ๊ธฐ๋ฅ X)