12월, 2013의 게시물 표시

maven 외부에서 사내저장소로 연결하지 못할 때

maven사용시 배포파일을 만들기 위해서 clean and package를 사용할 때 주의 해야 할 점 1. 외부에서 인터넷이 안될 때 사내 저장소에 있는 파일 들을 참조 할 수 없기 때문에 가지고 있는 인터페이스 파일을 clean and install 해줘야 package를 만들 수 있다. 2. 외부에서 참조하는 인터페이스를 최신으로 업데이트 하기 위해서는 clean and deploy를 실행해 줘야 잠조하고 있는 프로젝트들이 최신으로 참조해서 package 할 수 있다.

RCP 배포 후 class not found error 발생시 확인 사항

interface에서 build.properties javacDefaultEncoding.. = UTF-8 추가

mysql dump 로컬 밖에 DB 접속해서 할때

로컬에 밖에 있는 mysql 덤프 뜨는방법 mysqldump -h 192.168.0.1 -u -p databases > target

java map에 동일한 key에 value 추가하기

map을 사용해서 기존에 있는 key값에 값을 넣을때는 map.putIfAbsent(key,value) 을 이용하면 기존에 있는 값이 버려지지 않고 사용가능 한가?

mysql last insert id

mysql autoincreament 일 때 다음에 사용할 index 가져오기 <insert id="insert" parameterType="DeviceErrorLog">         INSERT INTO <include refid="tableName"/>         (             <include refid="baseColumns"/>         )         VALUES         (             <include refid="baseValues"/>         )         <selectKey resultType="_int" keyProperty="id" order="AFTER" >               SELECT LAST_INSERT_ID()         </selectKey>      </insert>

mysql 분단위 평균 값 구해서 사용하기(mybatis)

같은 구조의 테이블이라면 다음과 같이 모아서 사용하기 <select id="get5minList" resultMap="resultMapAvg">         SELECT date_format(log_time, '%Y-%m-%d %H:%i:%s') as time , truncate(avg(sensor_value),2) as sensor_value_avg, ${tableName}.* FROM ${tableName} <where> <if test="startDate != null"> log_time &gt;= #{startDate} </if> <if test="endDate != null"> AND log_time &lt;= #{endDate} </if> </where>     GROUP BY ceil(date_format(log_time,'%i')/5)   LIMIT 30000     </select> 위에서  ceil(date_format(log_time,'%i')/5) 이렇게 사용하면 5분 동안에 센서 데이터 값의 avg를 구해서 사용할 수 있다.

java 캘린더를 이용하는 방법

달을 원하는 만큼 돌리기 import java.text.ParseException; import java.util.Calendar; import java.util.GregorianCalendar; public class CalendarMain {        static java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat(             "yyyy-MM" , java.util.Locale. KOREA );               /**        * @param args        * @throws ParseException         */        public static void main(String[] args) throws ParseException        {                           StringBuilder sb = new StringBuilder();     ...