DBMS : MariaDB오류 메시지 : java.lang.NumberFormatException: For input string: "Y" MyBatis에서 비교문을 사용하여 select문을 실행했을 때 발생한 오류 메시지입니다.select * from TEST_TABLEWHERE 1 = 1 and test_column = 'ABC' and test_column != 'ABC' MyBatis는 OGNL 표현식을 사용하여 작은따옴표를 사용한 'Y'는 CHAR로 인식하기 때문에 오류가 발생합니다.MyBatis에서 N 혹은 Y와 같은 한 개의 문자로 비교문을 사용할 땐 큰따옴표를 사용하면 됩니다.큰따옴표를 사용하면 String으로 인식해 오류를 해결할 수 있습니다.sel..
StringUtils.equals()에 대해 알아보겠습니다. 먼저 equals()는 문자열을 비교하는 method입니다.java Object Class들 중에서 자주 사용하고 있는 equals() method가 있습니다. StringUtils에서도 equals() method를 사용할 수 있습니다.StringUtils.class안에 method들 중 아래와 같은 method로 선언되어있는 걸 확인해 볼 수 있습니다.public static boolean equals(final CharSequence cs1, final CharSequence cs2) { if (cs1 == cs2) { return true; } if (cs1 == null || cs2 == null) { ..
DBMS : MariaDB오류 메시지 : java.sql.SQLSyntaxErrorException: Incorrect integer value: '' for column mybatis에서 update문 실행했을 때 발생한 오류 메시지입니다.update TEST_TABLEset test_sn = #{testSn}test_sn의 datatype은 int type으로 #{testSn}의 값이 '' 공백으로 인해 발생한 오류입니다. varchar type이었으면 나지 않을 에러인데 int type이라 발생한 오류인 거 같습니다. 해결방법으론 java 쪽에서 데이터 값이 '' 공백일 때 0으로 변경해서 넘겨주든지 여러 가지 방법이 있겠지만저는 아래와 같이 case when then을 사용해서 해결했습니다.upd..
contains()에 대해 알아보겠습니다. contains()는 특정값이 포함되어있는지를 true/false으로 반환하는 메서드입니다. 먼저 아래와 같이 작성하여 특정값이 포함되어있는지를 확인할 수 있습니다.String[] strArr = {"가","나","다"};String cmprVal = "가";boolean bCheck = false;for(String a : strArr){ if(a.equals(cmprVal)){ bCheck = true; }}System.out.println(bCheck);결과 : true 두 번째부터는 contains() 메서드를 사용하여 특정값이 포함되어있는지를 확인해보겠습니다.strArr 배열에 contains()를 사용하려면 Arrays.asLi..
CollectionUtils.isEmpty()에 대해 알아보겠습니다.import org.springframework.util.CollectionUtils; CollectionUtils.isEmpty()는 java Collection(List, Map, Set)의 종류의 값들의 존재 여부를 판단하는 메서드입니다.List list = new ArrayList();Set set = new HashSet();Map map = new HashMap();boolean bListEmpty;bListEmpty = CollectionUtils.isEmpty(list);System.out.println("list : " + bListEmpty);bListEmpty = CollectionUtils.isEmpty(set);S..
isEmpty()에 대해 알아보겠습니다. isEmpty()는 String 변수의 값의 존재 여부를 판단하는 메서드입니다.String a = "";String b = null;System.out.println(a.isEmpty()); // 결과: trueSystem.out.println(b.isEmpty()); // 결과: NullPointerExceptionString.java안에 method들 중 아래와 같은 method로 선언되어 있는 걸 확인할 수 있습니다.public boolean isEmpty(){ return value.length == 0;}isEmpty()를 int 변수에 사용하게 되면 java: int cannot be dereferenced와 같은 에러 메시지를 확인할 수 있습니다..
- Total
- Today
- Yesterday
- isalpha
- zip
- counter
- index
- Upper
- find
- function
- Lower
- Built-in Functions
- Method
- bool
- permutations
- Lambda
- Python
- operators
- combinations
- isdigit
- for
- If
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |