개발도구/IDE

[eclipse] DBCP사용

노루아부지 2019. 7. 21. 00:51

1. Eclipse Servers 프로젝트의 context.xml에 아래 내용 추가

 

<?xml version="1.0" encoding="UTF-8" ?><?xml:namespace prefix=o />

<Context docBase="test" path="WEB-INF/프로젝트명" reloadable-"true">

<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/postgres" auth="Container"
          type="javax.sql.DataSource"
          username="test"
          password="test"
          factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
          driverClassName="org.postgresql.Driver"
          url="jdbc:postgresql://192.168.10.241[서버IP]:5432[포트번호]/postgres"
          maxActive="8" maxIdle="4"
          removeAbandoned="true"/>
</Context>

 

2. 프로젝트 내부의 web.xml tomcat->conf->web.xml과 같은 내용을 추가

3. Ojdbc14.jar 파일을 다운받아 [프로젝트] – [WebContent] - [WEB-INF]-[lib]폴더에 넣어준다.

4. Postgresql-버전.jdbc.jar 파일을 [프로젝트] – [WebContent] - [WEB-INF]-[lib] 폴더에 넣어준다.

728x90
loading