본문 바로가기
반응형

전체 글335

[Spring Boot] log4j 설정 application.properties #### Database # oracle spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy spring.datasource.url=jdbc:log4jdbc:oracle:thin:@localhost:1521/XE spring.datasource.username=system spring.datasource.password=0000 # mysql spring.datasource.driver-class-name=net.sf.log4jdbc.sql.jdbcapi.DriverSpy spring.datasource.url=jdbc:mysql://127.0.0.1:3306/demo?autoReconn.. 2023. 3. 10.
[Spring Boot] application.properties(oracle연동, devtools, thymeleaf) # 포트 지정server.port=9090#### Databasespring.datasource.driver-class-name=oracle.jdbc.OracleDriverspring.datasource.url=jdbc:oracle:thin:@localhost:1521/XEspring.datasource.username=systemspring.datasource.password=0000#### thymeleafspring.thymeleaf.prefix=classpath:templates/spring.thymeleaf.check-template-location=truespring.thymeleaf.suffix=.htmlspring.thymeleaf.mode=HTML5spring.thymeleaf.cache.. 2023. 3. 10.
[프로그래머스 - JAVA] 외계행성의 나이 내 풀이 class Solution { public String solution(int age) { String answer = ""; String[] ageWord = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j" }; String str = String.valueOf(age); for (int i = 0; i < str.length(); i++) { for (int j = 0; j < ageWord.length; j++) { if (String.valueOf(j).equals(String.valueOf(str.charAt(i)))) { answer += ageWord[j]; } } } return answer; } } int age를 문자열로 변형 시켜서 c.. 2023. 3. 10.
[프로그래머스 - JAVA] 가장 큰 수 찾기 내 풀이 class Solution { public int[] solution(int[] array) { int[] answer = {}; answer = new int[2]; int max = 0; for (int i = 0; i max){ max = array[i]; answer[0] = array[i]; answer[1] = i; } } return answer; } } 코드를 더 줄여보고 싶었는데 이것저것 하다가 실패했다...ㅠ 다른 사람 풀이 import java.util.*; import java.util.stream.Collectors; class Solution { public int[] solution(int[] arra.. 2023. 3. 10.
[프로그래머스 - JAVA] 배열 회전시키기 내 풀이 import java.util.Arrays; class Solution { public int[] solution(int[] numbers, String direction) { int[] answer = {}; answer = new int[numbers.length]; if(direction.equals("right")) { answer[0] = numbers[numbers.length - 1]; for (int i = 0; i < numbers.length - 1; i++) { answer[i + 1] = numbers[i]; } } else if (direction.equals("left")) { answer[numbers.length -1] = numbers[0]; for (int i =.. 2023. 3. 10.
[프로그래머스 - JAVA] 인덱스 바꾸기 내 풀이 class Solution { public String solution(String my_string, int num1, int num2) { String answer = ""; String[] split = my_string.split(""); for (int i = 0; i < split.length; i++) { if (i == num1){ answer += split[num2]; }else if(i == num2){ answer += split[num1]; }else { answer += split[i]; } } return answer; } } 다른 사람 풀이 import java.util.Arrays; import java.util.Collections; import java.util.. 2023. 3. 10.
반응형