반응형

처음 배우는 스프링 부트 2

 

책 자체가 현재 구성과 맞지 않아 저자에게 문의하였고

(무료 IntelliJ + start.spring.io 설정 맞추기)

 

3줄 회신이 왔는데 아래를 참고하라고 하였습니다.

 

아쉬운건 변화 무쌍한 환경에서 변경되는 내역 업데이트를 위한 게시판이 없는게 많이 아쉽네요

 

회사에서 스프링 부트 관련하여 같이 공부할 책을 찾고 있는 중인데

 

결정에 많은 도움이 되었네요

 

※ 만약 oracle JDK8이 아닌 OpenJDK 8로 사용하고 plugins 방식으로 gradle 빌드하면 무조건 오류가 납니다.

 

-------------------------------------------------- 

 

**Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target**
** ... 255 more**
**Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target**
** ... 255 more**

 

-------------------------------------------------- 

 

위의 경우는 가볍게 OpenJDK 11로 다운받아 JAVA_HOME 설정후 build gradle 수행하면 잘 됩니다 !

(cacerts 방식은 Oracle JDK에만 해당되는것 같네요)

책 발매일은 모르겠지만, 이제는 JDK 11이상으로 사용하지 않을까 싶네요...

 

인텔리제이 설정 참고 : https://www.bsidesoft.com/6926

 

buildscript 방식과 plugins 방식이 존재하며, 

start.spring.io에서는 plugins(신규) 방식으로 build.gradle 가 만들어 집니다.

아래는 buildscript 방식

 

-------------------------------------------------- 

 

buildscript {
    ext{
        springBootVersion='2.2.6.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'com.bsidesoft'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

 

-------------------------------------------------- 

 

 

74 Page : 3.1 @SpringBooTest 프로젝트 파일

책 교제와 다르게 오류가 발생하여 아래 내역을 업데이트 한 파일

-> SpringBootVersion : 2.2.6

    Gradle : 4.10.1 

3.1장_SpringBootTest_74p.zip
0.08MB

 

-------------------------------------------------- 

 

 

80 Page : 3.2 @WebMvcTest 프로젝트 파일

책 교제와는 다르게 /src/main/resource/templates/book.html 추가해야 됨(book 객체를 얻어옴)

book.html 파일 내용

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>book</title>
</head>
<body>

</body>
</html>

3.2장_SpringBootTest_80p.zip
0.08MB

 

-------------------------------------------------- 

 

81 Page: 3.3 @DataJpaTest

기본적으로 lombok 를 설치하지 않으면 builder() 메서드 밑에 붉은색 줄이 가면서

문제를 야기 시킨다.

File -> Settings -> Plugins -> 상위탭에서 Marketplace 선택 -> lombok 선택 후 설치 -> ide 재기동 

 

File -> Settings -> Build, Excution, Deployment -> Compiler -> Annotation Processors 선택

우측에

Enable annotation processing 선택 -> OK

 

3.3장_SpringBootTest_81p.zip
0.08MB

 

-------------------------------------------------- 

 

 

88 Page : 3.4 @RestClientTest

만약 위의 lombok 를 체크하지 않으면 BookRestTest.java 에서 book.getTitle() 부분의 오류가 보임

3.4장_SpringBootTest_89p.zip
0.08MB

 

-------------------------------------------------- 

 

 

90 page : 3.5 @JsonTest

3.5장_SpringBootTest_91p.zip
0.08MB

 

-------------------------------------------------- 

 

 

96 Page : 신규 커뮤니티 게시판 프로젝트 Web 구성 의존성 관련(2020.05.19)

 

-------------------------------------------------- 

 

 

109 Page 예제 4-9전 까지 압축파일

build.gradle 부분의 약간 수정이 필요

 

4장_web_109p.zip
0.16MB

 

* 설정 (build.gradle)

sping boot 2.2.x 부터는 Junit 5으로 사용되기 때문에

 

 

-------------------------------------------------- 

 

	(2.2.x 부터 추가된 설정으로 Junit 5설정으로 예제 돌리면 오류)
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
	}
    
    * 위의 부분에서 { ~ } 까지를 빼면 Junit 4설정으로 수행되기 때문에 오류 없음
    * 또한 위의 설정으로 Test들을 수행하면 @RunWith, @Before, @Test 등이 모두 오류 발생   

 

또는 아래 URL을 참고하여 JUnit 5으로 넘어가도 됨...

java.ihoney.pe.kr/525

 

[springboot] JUnit 5 적용기

이미 나온지 꽤 시간이 흐른 Junit 5를 살펴보기 시작한다.

java.ihoney.pe.kr

 

-------------------------------------------------- 

 

 

plugins {
    id 'org.springframework.boot' version '2.3.0.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'java'
}

group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    compileOnly 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'com.h2database:h2'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation('org.springframework.boot:spring-boot-starter-test')
}

test {
    useJUnitPlatform()
}

 

-------------------------------------------------- 

 

여기 다음 부터는 비공개로 쑥 ~

 

반응형
반응형


오라클에서 


EXP -> IMP 하는 방식에는


exp 테이블 스키마 추출

exp id/passwd file=./temp.dmp log=./log.log compress=n rows=n


 imp id/passwd indexfile=create.sql full=y 옵션을 주어


입력하지는 않고 create.sql을 만들어


스크립트 형태로 수동으로 돌릴 수 있다.


다만,


그냥 import 했을 때는


커져버린 초기값을 만나게 되는데...


이것을 수정하는 방법은


initial, next 값 수정!


- 테이블 스페이스 생성시 local로 생성해야만 함 ~

확인 쿼리

SELECT initial_extent, next_extent, pct_increase,

            extent_management, allocation_type

     FROM DBA_TABLESPACES

     WHERE tablespace_name=upper('테이블스페이스명');


- initial 값 수정


1. 분석하기 (emp1 테이블 분석)


analyze table emp1 compute statistics;


2. 분석을 기준으로 사용하지 않는 불럭 초기화

alter table emp1 deallocate unused keep 0;


3. 블럭 사이즈  확인 하는 법

select table_name, initial_extent from user_tables;


** 다른 방법


1. alter and move the table to another tablespace. e.g. (다른 테이블 스페이스로 옮기기)

ALTER TABLE MY_TABLE MOVE TABLESPACE ANOTHER_TABLESPLACE STORAGE (INITIAL 2M NEXT 2M PCTINCREASE 0);

2. alter and move the table back to the original tablesace with the desired initial extent size, e.g. (원 테이블 스페이스에 옮기기)

ALTER TABLE MY_TABLE MOVE TABLESPACE ORIGINAL_TABLESPACE STORAGE (INITIAL 256M NEXT 2M PCTINCREASE 0);



- next 값 수정

위와 동일하며


alter table emp1 storage(next 10M);


으로 가능함 

반응형

'Database > ORACLE' 카테고리의 다른 글

도스 모드 sql 실행 bat 배치 만들기  (0) 2016.03.25
ndd 설정하기  (0) 2013.09.23
오라클 미디어 팩 신청하기  (0) 2013.01.31
one port multi listener 설정 하기  (0) 2012.12.24
DBMS_XPLAN 정보 조회  (0) 2012.09.07

+ Recent posts