[ DBCP로 OracleDB에 접속 ] → 메모리 누수 발생 방지 / 여러명과 DB를 공유해서 사용할 경우에 적합

※ [ 10월 25일 ] 내용 참고

< day1109 – WEB-INF – (Folder) lib : ojdbc8.jar > : 드라이버 설치

< day1109 – META-INF : (XML) context > : [ 단계 1 ] Context configuration

<?xml version="1.0" encoding="UTF-8"?>
<Context>
	<Resource 
	name="jdbc/myoracle" 
	auth="Container"
	type="javax.sql.DataSource" 
	driverClassName="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@127.0.0.1:1521:xe"
	username="the" 
	password="oracle" 
	maxTotal="20" 
	maxIdle="10"
	maxWaitMillis="-1"/>
</Context>

< day1109 – WEB-INF : (XML) web > : [ 단계 2 ] web.xml configuration

<?xml version="1.0" encoding="UTF-8"?>
<web-app 
xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" 
xmlns="<http://xmlns.jcp.org/xml/ns/javaee>" 
xsi:schemaLocation="<http://xmlns.jcp.org/xml/ns/javaee> <http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd>" 
version="4.0">
  
  <display-name>day1109</display-name>
  
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  
  <resource-ref>
  <description>Oracle Datasource example</description>
  <res-ref-name>jdbc/myoracle</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
  </resource-ref>
  
</web-app>