본문 바로가기
Programming/Jsp

[JSP] JDBC 커넥션풀 설정 소스 / server.xml / web.xml

by prinha 2020. 7. 21.
728x90
반응형

Server.xml

---mysql---
<Resource name="jdbc/jsptesto"
           auth="Container"
           type="javax.sql.DataSource"
           driverClassName="com.mysql.cj.jdbc.Driver" 
           username="ora_user"
           password="1234"
           url="jdbc:mysql://localhost:3306/jsptest?serverTimezone=UTC"
           maxWait="5000"       
/>

--Oracle ---
<Resource name="jdbc/jsptesto"
          auth="Container"
          type="javax.sql.DataSource"
          driverClassName="oracle.jdbc.driver.OracleDriver"
          maxWait="5000"
          username="scott"
          password="tiger"
          url="jdbc:oracle:thin:@localhost:1521:orcl"
 />

 

web.xml

--- mysql ---
<resource-ref> 
    <description>jsptest db</description> 
    <res-ref-name>jdbc/jsptest</res-ref-name> 
    <res-type>javax.sql.DataSource</res-type> 
    <res-auth>Container</res-auth> 
</resource-ref>

--Oracle ---
<resource-ref> 
   <description>jsptest oracledb</description> 
   <res-ref-name>jdbc/jsptesto</res-ref-name> 
   <res-type>javax.sql.DataSource</res-type> 
   <res-auth>Container</res-auth> 
</resource-ref> 
728x90
반응형