카테고리 없음2015. 2. 19. 22:39
http://m.news.naver.com/read.nhn?mode=LSD&mid=sec&sid1=004&oid=310&aid=000003809
Posted by 선한열심
카테고리 없음2015. 2. 4. 18:58
update test t
set t.title = (
select p.title
from pms p
where p.id = t.id
)
where r.title is null
and exists (
select p.title
from pms p
where p.id = r.id
)

Posted by 선한열심
카테고리 없음2015. 1. 7. 09:02
like 검색시 '%${userName}%' 으로 안하면 부적합한 인덱스 오류하고 나온다
Posted by 선한열심
카테고리 없음2015. 1. 2. 20:37
http://www.coolio.so/spring-redirect시에-데이타-숨겨서-넘기는-방법/


http://roqkffhwk.tistory.com/m/post/121
Posted by 선한열심
Oracle2014. 11. 1. 18:30

설치 참조 : http://dkatlf900.tistory.com/59

삭제 참조 : http://blog.naver.com/ssgstar/30005414742


====================
 오라클 서비스 실행 확인
===================
*** :
OracleService***       실행
//OracleOraHome92TNSListener  실행
OracleOraHome92Agent        실행
OracleMTSRecoveryService    실행

기타


===============
설치시
===============
기본 전역 데이터베이스 이름 : orcl

sys(sys),system(system) 암호는 설치마지막쯤에 물어본다 (안물어보면 접속 불가)


===============
로그인
===============
system 으로 로그인 하여 아래 tablespace와 user를 만든다


==========================
== 자주 사용하는 쿼리  ==
==========================
select * from v$nls_parameters  // 캐릭터셋
select CONVERT('지송','UTF8','KO16KSC5601') //

 

==========================
== DATA TABLESPACE 생성 ==
==========================
CREATE TABLESPACE jungws_db_oralce
DATAFILE 'D:\01_JUNGWS_DB\01_oralce\jungws_db_oralce.TBL' SIZE 50M
AUTOEXTEND ON NEXT 10M MAXSIZE 500M
DEFAULT STORAGE
      (INITIAL     4K
              NEXT        128K
              MINEXTENTS  1
              PCTINCREASE 0);

 

==================================
==  TEMPORARY  TALBESPACE 생성  ==
==================================
CREATE TEMPORARY TABLESPACE jungws_db_oralce_temp
TEMPFILE 'D:\01_JUNGWS_DB\01_oralce\jungws_db_oralce_temp.tbl' SIZE 30M
AUTOEXTEND ON NEXT 10M MAXSIZE 500M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;


 
=================
== 사용자 생성 ==
=================
CREATE USER jungws IDENTIFIED BY jungws
DEFAULT TABLESPACE jungws_db_oralce
TEMPORARY TABLESPACE jungws_db_oralce_temp;

-- 권한 설정
-- 생성한 사용자에게 자신의 schema에서 테이블등을 만들 권한과 자원을 사용할 권한을 준다.
-- GRANT RESOURCE, CONNECT TO MIDAN;
-- DBA 권한을 준다.
GRANT connect, resource , DBA TO jungws;

 


==============
 오류 메시지
==============
ORA-12571: TNS 패킷 기록자 실패
ORA-03113: 통신 채널에 EOF 가 있습니다


TNS:작동이 중단중입니다
  -> 방화벽으로 막혀있을때 ( aaaaa윈도우에서 1521포트열고 , bin/oralce.exe 프로그램추가 해야함 )
 
C:\oracle\ora92\network\admin\tnsnames.ora 파일에서 직접확인해본다
  UCWAREDB =    <=== 접속이름 (아무거나)
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 121.78.116.216)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = UCWAREDB)   <=== SID
    )
  )
 


 

'Oracle' 카테고리의 다른 글

group by 시 null 은 빠짐   (0) 2014.04.22
[oracle] 권한 및 synonym ,DB Link   (0) 2014.04.16
[oracle] PL/SQL For loop 사용 샘플  (0) 2014.03.20
[Oralce] 이전날짜조건으로 검색  (0) 2014.03.18
[oracle] Decode 과 case when 비교  (0) 2014.03.05
Posted by 선한열심
Oracle2014. 4. 22. 08:18

'Oracle' 카테고리의 다른 글

오라클 설치 후 작업  (0) 2014.11.01
[oracle] 권한 및 synonym ,DB Link   (0) 2014.04.16
[oracle] PL/SQL For loop 사용 샘플  (0) 2014.03.20
[Oralce] 이전날짜조건으로 검색  (0) 2014.03.18
[oracle] Decode 과 case when 비교  (0) 2014.03.05
Posted by 선한열심
JAVA2014. 4. 19. 11:31


[JAVA] FilenameFilter 를 이용한 특정 확장자 파일리스트 가져오기


하위디렉토리 폴더와 파일 읽기


import java.io.*; 

import java.util.ArrayList;

import java.util.Collections; 



public class folderInReader {



    private static ArrayList<String> list = new ArrayList<String>(); 

    

public static void main(String[] args) throws IOException {


        String message = null;

        String filePath = ".";

        File path = new File( filePath );

        

        if( path.exists() == false ){

            System.out.println("경로가 존재하지 않습니다");

        }

        File[] fileList = path.listFiles();

        

        int tab = 1;

        for( int i = 0 ; i < fileList.length ; i++ ){

            if( fileList[ i ].isDirectory() ){

                message = "[디렉토리] ";

                message += fileList[ i ].getName();

                System.out.println( message );

                subDirList(  fileList[ i ].getName(), tab);

               

                Collections.reverse(list); 

                

                for(String str:list) {

                System.out.println(str);

                }

                

                list.clear();

                                             

            }else{

                message = "[파일] ";

                message += fileList[ i ].getName();

                System.out.println( message );

            }

            

        }

        

    } 

private static void subDirList(String source, int tab){

File dir = new File(source); 

File[] fileList = dir.listFiles(); 

 

String sTab = "";

for ( int i =0 ; i < tab ; i++){

sTab +="\t";

}

try{

for(int i = 0 ; i < fileList.length ; i++){

File file = fileList[i]; 

if(file.isFile()){

    // 파일이 있다면 파일 이름 출력

if( i==0 ){

//System.out.println("[디렉토리 이름] = " + dir.getPath()   );

list.add("[디렉토리 이름1] = " + dir.getPath() ) ;

}

//System.out.println(sTab + " 파일 이름 = " + file.getName());

list.add(sTab + " 파일 이름 = " + file.getName() );

}else if(file.isDirectory()){ 

    // 서브디렉토리가 존재하면 재귀적 방법으로 다시 탐색

subDirList(file.getCanonicalPath().toString(),tab+1);

list.add("[디렉토리 이름2] = " + dir.getPath() );

//System.out.println("[디렉토리 이름] = " + dir.getPath()   );

}

}

}catch(IOException e){

}

 

}



}



'JAVA' 카테고리의 다른 글

[펌]jar 내부 파일 읽기  (0) 2014.04.19
[펌]Java Architecture for XML Binding (JAXB) 예제  (0) 2014.03.03
[ERROR] java 오류 정리  (0) 2014.02.26
Socket으로 Mail 전송 샘플  (0) 2014.02.24
SMTP 서버를 통해 메일 전송  (0) 2014.02.19
Posted by 선한열심
JAVA2014. 4. 19. 09:34

[펌] http://cs.dvc.edu/HowTo_ReadJars.html



실행방법 : java JarRead JA파일명  경로/../읽을파일명   

예) java JarRead jersey-server-2.2.jar org/glassfis

h/jersey/server/wadl/processor/WadlModelProcessor.class


import java.io.*;

import java.util.jar.*;


public class JarRead 

{

  public static void main (String args[]) throws IOException 

  {

 System.out.println ("args.length=" + args.length );

    if (args.length != 2) 

    {

      System.out.println("Please provide a JAR filename and file to read");

      System.exit(-1);

    }

    JarFile jarFile = new JarFile(args[0]);

    JarEntry entry = jarFile.getJarEntry(args[1]);

    InputStream input = jarFile.getInputStream(entry);

    process(input);

  }


  private static void process(InputStream input) throws IOException 

  {

    InputStreamReader isr = new InputStreamReader(input);

    BufferedReader reader = new BufferedReader(isr);

    String line;

    while ((line = reader.readLine()) != null)

      System.out.println(line);

    reader.close();

  }

}

Posted by 선한열심
카테고리 없음2014. 4. 19. 07:58

자세한 내용 참고 : http://digicom.tistory.com/165 



META-INF :  jar파일 만들때 자동 생성되는 폴더로 그 안에 manifest 파일을 포함하고 있다

manifest :  jar 파일의 사용 메뉴얼이나 스펙을 갖고 있다고 보면 된다


 

 

Posted by 선한열심
카테고리 없음2014. 4. 17. 14:19
https://code.google.com/p/springbatch-in-action/source/browse/trunk/sbia/ch07/src/test/resources/com/manning/sbia/ch07/custom/JobCompositeItemWriterTest-context.xml?r=158



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:batch="http://www.springframework.org/schema/batch"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">

    <import resource="classpath:com/manning/sbia/ch07/test-batch-infrastructure-context.xml" />
    <import resource="classpath:com/manning/sbia/ch07/test-batch-reader-context.xml" />

        <job id="writeProductsJob" xmlns="http://www.springframework.org/schema/batch">
                <step id="readWrite">
                        <tasklet>
                                <chunk reader="productItemReader" writer="productItemWriter" commit-interval="3" />
                        </tasklet>
                </step>
        </job>
 
  <bean id="productItemWriter" class="org.springframework.batch.item.support.CompositeItemWriter">
    <property name="delegates">
      <list>
        <ref local="delimitedProductItemWriter"/>
        <ref local="fixedWidthProductItemWriter"/>
      </list>
    </property>
  </bean>

        <bean id="delimitedProductItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
                <property name="resource" value="file:target/outputs/composite-pipeseparator.txt"/>
                <property name="lineAggregator">
      <bean class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
        <property name="delimiter" value="|" />
        <property name="fieldExtractor">
          <bean class="org.springframework.batch.item.file.transform.BeanWrapperFieldExtractor">
            <property name="names" value="id,price,name" />
          </bean>
        </property>
      </bean>
     </property>
        </bean>

  <bean id="fixedWidthProductItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter">
    <property name="resource" value="file:target/outputs/composite-beanwrapperextractor.txt"/>
    <property name="lineAggregator">
      <bean class="org.springframework.batch.item.file.transform.FormatterLineAggregator">
        <property name="fieldExtractor">
          <bean class="org.springframework.batch.item.file.transform.BeanWrapperFieldExtractor">
            <property name="names" value="id,price,name" />
          </bean>
        </property>
        <property name="format" value="%-9s%6.2f%-30s" />
      </bean>
     </property>
  </bean>
  </beans>


Posted by 선한열심