본문 바로가기

전체 글20

STS : lombok(롬복) 설치 후 사용하기 lombok(롬복)은 코드 경량화에 유용한 라이브러리 중 하나입니다. 자바 개발시 필수적인 getter/setter의 사용을 아주 편리하게 만들어줍니다. 추가적으로 로깅(logging)도 편리하게 사용할 수있습니다. Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more. 롬복(.. 2022. 12. 15.
Spring Boot : jdbcTemplate을 이용한 PostgreSQL DB연동법 지난번 글에서 로컬에 PostgreSQL을 설치하고 DBeaver를 이용해 사용해봤으니 이번에는 PostgreSQL을 JAVA와 연결해보겠습니다. 2022.12.05 - [DATABASE] - PostgreSQL 15.1 설치 (Windows) PostgreSQL 15.1 설치 (Windows) PostgreSQL은 오픈소스 DBMS입니다. Oracle DB, MySQL, Microsoft SQL에 이어 많이 사용되는 DBMS로 알려져 있습니다. PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that ha devnam.tistory.com 2022.1.. 2022. 12. 9.
Spring Boot Appliction이 구동 될 때 실행되는 코드 추가하기 Spring Boot에서 SpringApplication이 구동 될 때 특정 코드를 실행하고 싶으면 ApplicationRunner, CommandLineRunner를 사용하면됩니다. 둘다 run 매서드 내부에 구현한 코드를 SpringApplication 구동시 실행하지만 차이점은 arguments를 받는 Parameter에 있습니다. ApplicationRunner : ApplicationArguments CommandLineRunner : String... (String 배열) ApplicationRunner 구현 package devnam.tistory.com; import org.springframework.boot.ApplicationArguments; import org.springframe.. 2022. 12. 7.
DBeaver 설치 및 PostgreSQL 연결하기(Windows) DBeaver는 SQL 클라이언트이자 데이터베이스 관리 도구입니다. 오픈소스이므로 자유롭게 사용이 가능합니다. https://dbeaver.io/download/ Download | DBeaver Community Download Tested and verified for MS Windows, Linux and Mac OS X. Install: Windows installer – run installer executable. It will automatically upgrade version (if needed). MacOS DMG – just run it and drag-n-drop DBeaver into Applications. Debian package dbeaver.io 사이트에 접속해서 환경에 .. 2022. 12. 6.
PostgreSQL 15.1 설치 (Windows) PostgreSQL은 오픈소스 DBMS입니다. Oracle DB, MySQL, Microsoft SQL에 이어 많이 사용되는 DBMS로 알려져 있습니다. PostgreSQL is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. https://www.postgresql.org/ PostgreSQL The world's most advanced open source database. www.postgresql.org .. 2022. 12. 5.
Java list 동일한 크기로 분할 나누기 (Guava) 자바 리스트(list)에 담겨있는 내용을 일정크기로 분할해서 리스트에 담고싶을때 사용하면 편리한 library가 있습니다. 바로 구글 Guava 입니다. guava의 partition 함수를 이용하면 편리하게 list를 분할할 수 있습니다. 설정 //pom.xml com.google.guava guava 31.1-jre //build.gradle dependencies { // Pick one: // 1. Use Guava in your implementation only: implementation("com.google.guava:guava:31.1-jre") // 2. Use Guava types in your public API: api("com.google.guava:guava:31.1-jre").. 2022. 12. 5.
마이바티스(mybatis) notEmpty,empty 사용하기 ibatis에는 있지만 mybtis에는 null체크할 수 있는 isEmpty,isNotEmty가 없습니다. 그래서 직접 구현한뒤 util로 만들어서 많이 사용을 합니다. 구현 package devnam.tistory.com; import java.lang.reflect.Array; import java.util.List; import java.util.Map; public class MybatisUtil { public static boolean empty(Object obj){ if( obj instanceof String ) return obj==null || "".equals(obj.toString().trim()); else if( obj instanceof List ) return obj==nu.. 2022. 12. 1.
마이바티스(mybatis) 자주 사용되는 쿼리,컬럼 재사용하기 mybatis 사용시 공통적으로 사용되는 쿼리(단순 컬럼명들도 가능)를 정의해두고 가져다가 사용할 수 있습니다. 사용법 재사용할 쿼리를 먼저 정의하고(sql id)정의한 쿼리를 다른곳에서 가져다가(include refid) 사용하면 됩니다. select aa,bb,cc ,dd ,ee from TEST 위와 같이 사용하면 aa,bb,cc,dd,ee가 모두 조회되는 쿼리가 완성됩니다. include는 여러개를 사용할 수 있습니다. 카운트같은 공통으로 필요한 컬럼이 있다면 다음과 같이 사용하면 유용합니다. SELECT cont(*) over as total_cnt, tt.* from ( ) as tt ( select aa,bb,cc from test 2022. 12. 1.
Font Awesome(폰트어썸) 아이콘 색상,크기,회전,애니메이션 효과주기 2022.11.29 - [FRONT-END/TIP & ETC] - Font Awesome(폰트어썸) 무료버전 4.7 CDN 사용방법 Font Awesome(폰트어썸) 무료버전 4.7 CDN 사용방법 Font Awesome은 인터넷으로 제공되는 아이콘 라이브러리 툴킷이라고 생각하시면 됩니다. 예전에는 아이콘을 사용하려면 직접 아이콘 파일을 서버에 올려서 사용했다면 Font Awesome을 이용하면 가져 devnam.tistory.com 이전글 Font Awesom 기본 사용법에 이어서 심화(?) 사용법을 다뤄보겠습니다. 기본 크기변경 크기는 각각 기본으로부터 fa-lg는 33%, fa-2x 2배, fa-3x 3배, fa-4x 4배, fa-5x 5배 증가된 크기입니다. 색상변경 style color 속성에 .. 2022. 11. 30.