== null은 참조 변수가 null 참조를 가지고 있는지 확인하는데 사용되며, empty() 메서드는 객체 자체가 "비어 있는지" 확인하는데 사용됩니다. empty() 메서드는 특정 클래스에서만 사용할 수 있으며, 클래스가 그러한 메서드를 제공해야 합니다. null 참조 변수에 empty() 메서드를 호출하려고 하면 NullPointerException이 발생합니다. 따라서 null 체크를 먼저 수행한 후 empty() 메서드를 안전하게 호출할 수 있습니다. String str = null; if (str != null && str.isEmpty()) { System.out.println("str is not null and str is empty"); }
데이터를 csv 파일에서 로드하여 DB에 insert 하는데 데이터 중간에 , (콤마)가 있는 데이터는 " (더블쿼테이션) 으로 감싸져있다. 내가 작성하던 소스는 row별 데이터를 ,로 split 하고 있었는데... opencsv를 발견하고 초 간단하게 해결! http://opencsv.sourceforge.net/ CSVReader reader = new CSVReader(new FileReader("yourfile.csv")); String [] nextLine; while ((nextLine = reader.readNext()) != null) { // nextLine[] is an array of values from the line System.out.println(nextLine[0] + ne..
- Total
- Today
- Yesterday
- timestamp
- CloudSearch
- tomcat
- 서버 환경변수
- iTerm
- cloudsearch 비용
- JPA
- Python
- org.hibernate.LazyInitializationException
- JPA 오류
- oracle12
- Elasticsearch
- ojdbc7
- getdate
- StAX
- aws cloudsearch
- db connect
- could not initialize proxy - no Session
- 엘라스틱서치
- JoinColumn
- 계층형
- OneToMany
- Big xml 파싱
- 단축키
- #csvreader
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |