server.xml
<GlobalNamingResources>
-- 추가
<Resource auth="Container"
autoReconnect="true"
driverClassName="org.postgresql.Driver"
maxActive="20"
maxIdle="10"
maxWrite="-1"
name="jdbc/postgres"
password="1234"
type="javax.sql.DataSource"
url="jdbc:postgresql://localhost:5432/postgres"
username="postgres"/>
-- 추가
</GlobalNamingResources>
context.xml
-- 추가
<Resource name="jdbc/postgres" auth="Container"
type="javax.sql.DataSource"
username="postgres"
password="1234"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/postgres"
autoReconnect="true"
maxActive="20"
maxIdle="10"
maxWrite="-1"/>
--추가
web.xml
--추가
<resource-ref>
<description>postgreSQL</description>
<res-ref-name>jdbc/postgres</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
--추가
postgresql-8.3-603.jdbc4.jar
C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib 밑에 추가
C:\Java\jre6\lib\ext 밑에 추가
(프로젝트이름)\WebContent\Web-inf\lib 밑에 추가 또는 외부라이브러리 추가..
에러
Cannot load JDBC driver class 'org.postgresql.Driver
드라이버를 못찾는다.. 드라이버가 제대로 추가 되어있는지 확인한다 .
경우 xml내용을 확인한다. 데이터베이스명, 패스워드 등.
PS 이클립스경우.. 이클립스안에 있는 Server프로젝트를 수정한다..
'Eclipse' 카테고리의 다른 글
웹 화면 설계용 툴 (0) | 2013.11.08 |
---|---|
Eclipse 3.7 + Svn (0) | 2011.12.01 |
이클립스 메모리 관리 (0) | 2011.07.12 |
eclipse 3.6 HeliosにVisualEditor을 인스톨 (0) | 2011.02.11 |
Eclipse 탭 스페이스 변경 (0) | 2010.08.06 |