본문 바로가기

[Java] System 클래스 nanoTime(); import java.util.*; public class NanoTimeTest{ public static void main(String[] args) { long cur = System.nanoTime(); /* for문을 돌려 시간 때우기*/ for(int i =0; i < 100000000; i++){} double elapsedTime=(System.nanoTime()-cur)/1000000.0; System.out.println(elapsedTime); } } /* - static long nanoTime(); 현재의 시간을 ns로 리턴한다(1/1,000,000,000 초) 이 메소드는 JDK 5.0 부터 추가됨 */ 더보기
[Java] System 클래스 currentTimeMillis() import java.util.*; public class CutTimeMillisTest{ public static void main(String[] args) { long cur1 = System.currentTimeMillis(); /* for문을 돌려 시간 때우기*/ for(int i =0; i < 100000000; i++){} long elapsedTime=System.currentTimeMillis()-cur1; System.out.println(elapsedTime); } } /* - static long currentTimeMillis(); 현재의 시간을 ms로 리턴한다(1/1,000초) */ 더보기
[Java] System 클래스 GetEnv() import java.util.*; public class GetEnv{ public static void main(String[] args) { Map envMap=System.getenv(); Set key = envMap.keySet(); Iterator it = key.iterator(); while(it.hasNext()){ String curKey = it.next().toString(); System.out.format("%s=%s\n", curKey, envMap.get(curKey)); } } } /* - static Map getenv(); 현재 시스템 환경을 스트링 형태의 맵으로 리턴한다. - static String getenv(String name); name에 지정된 환경 변수의.. 더보기
[Java] System 클래스 getProperties() import java.util.*; public class GetProperties{ public static void main(String[] args){ System.setProperty("addProperty", "Test System Method"); Properties prop = System.getProperties(); Set key = prop.keySet(); Iterator it = key.iterator(); while(it.hasNext()){ String curKey = it.next().toString(); System.out.format("%s=%s\n", curKey, prop.getProperty(curKey)); } } } /* - static Properties getP.. 더보기
[Java] System 클래스 arraycopy() public class SystemArrayCopy{ public static void main(String[] args){ String[] arr = {"AAA","BBB","CCC","DDD","EEE"}; String[] copyArr = new String[3]; System.arraycopy(arr, 2, copyArr, 1, 2); for(String value: copyArr){ System.out.println(value); } } } /* static void arraycopy(Object arr, int arrPos, Object copyArr, int copyPos, int length); 특정 배열을 복사할 때 사용한다. 여기서 arr는 복사 원본배열, copyArr는 복사한 값이 .. 더보기
[Oracle/Sql] link synonym grant 주기 --LINK 생성 CREATE PUBLIC DATABASE LINK 링크명 CONNECT TO 아이디 IDENTIFIED BY 패스워드 USING '서비스명 또는 통째로'; --SYNONYM 생성 CREATE PUBLIC SYNONYM 사용할시노님명(보통테이블명과동일하게사용) FOR 대상테이블명(보통테이블명과동일하게사용); DROP PUBLIC SYNONYM 삭제할시노님명; --권한 부여 GRANT INSERT ON 테이블명 TO 계정 또는 시노님; GRANT SELECT ON 테이블명 TO 계정 또는 시노님; GRANT UPDATE ON 테이블명 TO 계정 또는 시노님; GRANT DELETE ON 테이블명 TO 계정 또는 시노님; 더보기
[Java] 로또 프로그램 난수 생성기 !! (중복체크) java util 패키지를 이용해서 중복없는 로또 프로그램 만들기~!! import java.util.*; public class LottoNumber { public static void main(String[]args){ int[] numbers = new int[6]; Random gen = new Random(); for(int i =0 ; i 더보기
[Window cmd] 윈도우 command 창 명령어 a ADDUSERS CSV파일에서 사용자에게 목록을 추가 ARP 주소 확인 프로토콜 ASSOC 변경 파일 확장명 연결 ASSOCIAT 한 걸음 파일 협회 ATTRIB 변경 파일 속성 b BOOTCFG Windows 부팅 설정 수정 BROWSTAT 도메인, 브라우저 및 PDC에 정보를 가져오기 c CACLS 파일 사용 권한 변경 CALL 다른 한 일괄 프로그램을 호출 CD 변화 디렉토리 - 특정 폴더로 이동 CHANGE 변경 터미널 서버 세션 속성 CHKDSK 체크 디스크 - 검사 및 복구 디스크 문제 CHKNTFS NTFS 파일 시스템 체크 CHOICE 배치 파일 키보드 입력 받아들이기 CIPHER 암호화 또는 복호화 파일 / 폴더 CleanMgr 임시 파일의 자동 정리, 휴지통 CLEARMEM 누수된 .. 더보기