DB에 byte로 insert 하기, select 후 string으로 변경하기


DB에 byte로 insert 하기, select 후 string으로 변경하기

JAVA Controller 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 public void testByte() throws Exception { String tmp = "<html><body><p>홍길동</p></body></html>"; String cd = String.valueOf(System.currentTimeMillis()); map.put("CD", cd); map.put("VAL", tmp.getBytes()); dao.insertTest(map); Map<String, Object> tmpMap = dao.selectTest(); byte[] data = (byte[]) tmpMap.get("VAL"); String str = new String(data); System.out.println("########"); System.out.println(data); System.out.println(str); } Colored by Col...



원문링크 : DB에 byte로 insert 하기, select 후 string으로 변경하기