Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Tags
- Oracle
- postgresql
- 플러터
- JPA
- CS지식
- 자료구조
- Flutter
- backjoon
- DB
- 자바스크립트
- springboot
- 데이터베이스
- Spring Security
- 자바
- 리눅스
- 스프링
- 스프링부트
- javascript
- CS
- 프로그래머스
- 시큐리티
- 네트워크
- 스프링 부트 쇼핑몰 프로젝트 with JPA
- baekjoon
- 백준
- 데이터
- spring
- 파이썬
- python
- Java
Archives
- Today
- Total
Jin's Dev Story
[eGovFrame] 전자정부프레임워크 PostgreSQL 연동 본문
1. pom.xml dependency 추가
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.6.1</version>
</dependency>
⇒ 설정 후 할 일
- 프로젝트 우클릭 - Maven - Update Project
- 프로젝트 우클릭 - Run As - Maven clean
- 프로젝트 우클릭 - Run As - Maven install
2. DB 추가
- src/main/resouces/egovframework/srping/context-datasource.xml
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbc:postgresql://127.0.0.1:5432/postgres" />
<property name="username" value="이름" />
<property name="password" value="비밀번호" />
<property name="defaultAutoCommit" value="true"/>
<property name="defaultReadOnly" value="false"/>
<property name="initialSize" value="1"/>
<property name="minIdle" value="0"/>
<property name="maxTotal" value="20"/>
<property name="maxIdle" value="20"/>
<property name="maxWaitMillis" value="30000"/>
<property name="validationQuery" value="SELECT 1"/>
<property name="testOnBorrow" value="true"/>
<property name="testOnReturn" value="false"/>
<property name="testWhileIdle" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="60000" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
'Tools > eGovFrame' 카테고리의 다른 글
[eGovFrame] 전자정부프레임워크 설치 방법 (1) | 2024.06.13 |
---|---|
[eGovFrame] 전자정부프레임워크 (1) | 2024.06.13 |