JSP-MVC model2
Jsp-MVC2,Connection Pool
프리덕
2020. 8. 10. 19:35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
name="jdbc/MySQL"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/jsp_model2_db5"
username="root"
password="1234"
maxActive="100"
maxIdle="20"
/>
</Context>
//------------------------------------------------------
|
cs |
DAO에서 메서드마다 새로운 객체를 생성하면 메모리 낭비와 효율적이지 못하기 때문에
따로 Context.xml 파일로 커넥션 풀이라는 곳을 만들어서 필요한 곳에서 꺼내 쓰고 반환을 바로 할 수 있게 만들어 놓은 곳이다.