Properties 를 한번 사용할려고 여기저기, 자료를 찾을려고 기웃거려 봤는데..

워낙, 초보적인 내용이었는지.. 정리된것이 없더군요.


제가 가지고 있는 소스에 관련된 부분이 있어서.. 여기에 올립니다.

저초럼, 초보인 분에게 작은 도움이 될것 같아 올려봅니다.


......

간단히, 소스를 설명하자면..

PropertiesTest 실행할때

test.properties 라는 프로퍼티 파일을 가져오는데..

argument 가 있으면, test.properties 의 name 에 해당하는 value 를 불러오는거구요..

argument 가 없으면, test.properties 이의 프로퍼트에 value 을 변경시켜주는겁니다.~


test.properties 는 'PropertiesTest' class 가 있는 같은 디렉토리 위치에 있어야 겠지요.~


//===============================================================

//PropertiesTest.java
//===============================================================

import java.util.*;
import java.io.*;

class PropertiesTest {  

    public static void main(String[] args)  throws IOException   {
        Properties props = new Properties();
        if ( args.length == 0 )  {
            props.put("Name", "홍길동");
            props.put("Address", "Korea");
            props.store( new FileOutputStream("test.properties"), "My Comment");
        } else  {
            props.load( new FileInputStream("test.properties") );
        }

        System.out.println( "Name: " + props.getProperty("Name") );
        System.out.println( "Address: " + props.getProperty("Address") );
    }
}



//===============================================================

//test.properties

//===============================================================

#My Comment
Name=evergreen

Address=Korea

포 맷

설 명

범 위

포 맷

설 명

범 위

SS

0 ~ 59

MON

월 (약자)

JAN ~ DEC

SSSSS

자정 이후의 초

0 ~ 86399

MONTH

월 (영문)

JANUARY ~
DECEMBER

MI

0 ~ 59

YY

연도 끝 자리
두자

예) 98

HH

0 ~ 12

YYYY

연도 (네자리)

예) 1998

HH24

0 ~ 24

YEAR

철자화된 연도

DD

월간 일자

1 ~ 31
(28 , 30)

CC

세기

예) 19

DAY

요일

SUNDAY ~
SATURDAY

Q

분기

1 ~ 4

D

요일

1 ~ 7

J

율리우스력 일자

예) 2448000

DDD

년간 일자

1 ~ 366
(365)

W

월간 주

1 ~ 5

MM

1 ~ 12

WW

연간 주

1 ~ 52

AM,PM 오전/오후 출력

'오류 21002 SQL-DMO]'ncash' 사용자가 이미 있습니다.'

 

해결책 :

기존 Database에 있었던 사용자 계정을 만들 때 발생하는 오류이다.
sa로 로긴한 후 아래 문장을 해당 데이터베이스에서 실행한다.

 

SP_CHANGE_USERS_LOGIN 'UPDATE_ONE', 'aaa', 'aaa'

+ Recent posts