본문 바로가기

전체 글308

특정 위치에 파일 중복 여부 체크 하고 새로운 파일명 구하기 예제 특정 위치에 파일 중복 여부 체크 하고 새로운 파일명 구하기 예제 특정위치에 동일한 파일명이 존재하는지 체크하고 , 동일한 파일명이 존재한다면 ex) 파일(1).jpg , 파일(2).jpg로 변경 처리하는 방안 입니다! public static class ExtentionMethods { public static string FileNameDupCheck(this string fullPath) { if (File.Exists(fullPath)) { string reNamePath = string.Empty; string filePath = Path.GetDirectoryName(fullPath); string fileName = Path.GetFileNameWithoutExtension(fullPath).. 2023. 8. 23.
Mybatis PlatformTransactionManager 프로그래밍 방식으로 호출 진행 예 스프링 PlatformTransactionManager 로 DB 트랜잭션 관리하는 방법 : 네이버 블로그 (naver.com) 스프링 PlatformTransactionManager 로 DB 트랜잭션 관리하는 방법 스프링 PlatformTransactionManager 로 DB 트랜잭션 소스 코드를 개발하는 방법은 다음과 같습니다. 1... blog.naver.com 1. contextConfigLocation 의 XML 에 bean으로 추가 합니다.! 2. Service 의존성 주입 진행 3. Service Class 에 선언 진행 public class TestService { private SqlSession sqlSession; private PlatformTransactionManager tra.. 2023. 8. 17.
[JAVA] gradle 이용 runnable jar 생성 시에 dependency library 포함 진행 build.gradle에 dependencies 에 명시한 lib들을 포함 하기 위하여 아래 스크립트를 삽입 하였습니다! dependencies { // Use JUnit Jupiter for testing. testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' // This dependency is used internally, and not exposed to consumers on their own co.. 2023. 7. 5.
[JAVA] CloseableHttpClient를 이용한 Http Post 호출 예제 CloseableHttpClient 이용 Http Post 호출 예제입니다. /** * * @param jsonString * @param urlAddress * @return */ private static boolean httpClient(String jsonString,String urlAddress) { String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); try { HttpPost httpPost = new HttpPost(urlAddress); httpPost.setHeader("Content-Type" , "application/x-www-form-urlencoded;charset=UTF-8"); List.. 2023. 7. 5.
LocalDateTime,TimeStamp 이용 timestamp 값 얻기 (new Date()).getTime() 이 Deprecate 상태 여서 다른 방법을 찾아 보았습니다. module-info.java /** * */ module TestConsole { requires java.sql; } TestCls.java package com.test; import java.time.LocalDateTime; import java.sql.Timestamp; public class TestCls { public static void main(String[] args) { LocalDateTime localDateTime = LocalDateTime.now(); Timestamp timeStamp = Timestamp.valueOf(localDateTime); long lNow =.. 2023. 7. 3.
Ubuntu 20.04.5 TimeZone 변경 방안 출처 : Linux : Ubuntu 20.04 : Timezone 설정, 변경 방법, 예제, 명령어 (tistory.com) Linux : Ubuntu 20.04 : Timezone 설정, 변경 방법, 예제, 명령어 많은 시스템 관련 작업 및 프로세스에는 정확한 시간대를 사용하는 것이 필수적입니다. 예를 들어, 크론 대몬은 크론 작업을 실행하기 위해 시스템의 시간대를 사용하고 로그 파일의 타임스탬 jjeongil.tistory.com Ubuntu GUI 에서는 설정을 변경 할 수 없어 출처의 내용 과 같이 UTC 기준에서 Asia/Seoul로 변경 시도를 하였습니다. $ timedatectl Local time: Mon 2023-07-03 08:05:33 UTC Universal time: Mon 202.. 2023. 7. 3.
[MFC] Windows Service 시작 / 중지 상태 확인 제어 예제 아래는 Windows Printer Spooler ( spooler ) 서비스 시작 중지 예제 입니다. if (bResult == TRUE) { StopSpooler(); Sleep(2000); StartSpooler(); } BOOL StopSpooler() { SC_HANDLE schService; SC_HANDLE schSCManager; // Machine NULL=local , database NULL= default schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT); if (!schSCManager) { Log(L"%s OpenSCMManager 함수 호출이 실패 하였습니다. GetLastError=%d", __FUNCTIONW__, .. 2023. 6. 27.
RegOpenKeyEx 32bit 응용프로그램에서 64bit Registry 접근 예제 출처 : winapi - C++ read a Registry entry in SOFTWARE\WOW6432 from a 64-bit app - Stack Overflow 2023. 6. 22.
[Mysql] TABLE Partition 구성 테스트 진행 출처 : MySQL Partition 파티션(1) - 정의와 기능 설명 파티션 제약사항 | Hoing MySQL Partition 파티션(1) - 정의와 기능 설명 파티션 제약사항 hoing.io * 현재 운영 테이블 COLUMN의 경우 년월일시형태의 문자열로 구성되어있는 상태입니다,,,, Data Type 이 VARCHAR 이다 보니 , 년월일시형태의 문자열 VARCHAR COLUMN 을 기준으로 파티션을 RANGE 로 구성하여 테스트 진행 해보았습니다. * TABLE에 Partition 구성시에 PRIMARY KEY COLUMN을 구성하시려는 경우 PARTITION을 구성하는 컬럼 이외에 다른 컬럼으로 지정은 안되는 것을 확인 하였습니다 -0-;;;; [ Partition을 구성하는 컬럼이 무조건 포.. 2023. 6. 13.