본문 바로가기

IT칼럼

myBatis/iBatis 특수문자 사용하기 CDATA myBatis 에서 XML 쿼리 사용시 (예, , \ ) 사용 시 로 특수문자를 감싸지 않으면 쿼리 사용 시 에러가 발생한다. 태그내 존재하는 꺽쇠랑 동일하기 때문에 혹은 \ 같은 경우 escape 문자로 인식하기 때문에 다음 문자를 빼고 동작하기 때문이다.. 이를 해결하기 위해서 특수 문자 에 꼭 로 감싸 주워야 한다. 1. CDATA 섹션 - 정의 CDATA 섹션 내의 문자나 기호는 태그 형식이나 코드로 인식하지 않고 그대로 문자 형식으로 취급 되므로 특수 문자가 많은 경우에는 CDATA 섹션을 이용하면 유용함 - 예제 SELECT * FROM HELLO WHERE A>B AND A 2. 사용법 - 예제 SELECT * FROM HELLO WHERE A]]>B CDATA를 사용하지 않고 myBatis.. 더보기
ExpressJS 를 이용하여 index.html 파일 view Use ExpressJS to Deliver HTML Files 다음 command를 사용하여 express js 시작하기 server.js index.html 파일 생성 $ mkdir express-sendfile $ cd express-sendfile $ npm init $ npm install express --save $ touch server.js index.html server.js ar express = require('express'); var app = express(); var path = require('path'); // viewed at http://localhost:8080 app.get('/', function(req, res) { res.sendFile(path.join(__.. 더보기
iframe 으로 get request 이용하여 데이터 전달하기 + spring boot 1. main.html Your browser does not support inline frames. 2. iframe.html 3. spring controller @GetMapping(“/index”) public String iframeHome(){ return “/index”; } @GetMapping("/iframe") public String iframeTest(@RequestParam Map requestParams, Model model){ String username = requestParams.get("username"); String password = requestParams.get("password"); model.addAttribute("username", username); .. 더보기
지정된 달에서 특정요일(수, 금 ,토)에 해당하는 날짜 받아오기 import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; import java.util.Map; public class TestMain { public static void main(String args[]) throws ParseException{ // create a Calendar for the 1st of the required month //int year = 2019; //int month = Calendar.APRIL; String da.. 더보기
Java - String to Integer 1. Integer.parseInt() String number = "10"; int result = Integer.parseInt(number); System.out.println(result); output 10 더보기
SinglyLinkedList 만들기 & 처음부터 끝까지(null) data 출력하기 Start->10->1->8->11-> null SinglyLinkedList.java public class SinglyLinkedList{ private ListNode head; private static class ListNode { private int data; private ListNode next; ListNode(int data){ this.data=data; this.next=null; } } public static void main(String[] args){ SinglyLinkedList sll = new SinglyLinkedList(); sll.head = new ListNode(10); ListNode second = new ListNode(1); ListNode third .. 더보기
JSX의 개념과 기본 문법 소개 1. 개념 소개 XML/HTML-like syntax that extends ECMAScript so that XML/HTML-like text can co-exist with JavaScript/React code. 확장자 - .jsx => .js 사용하는 추세 (fb에서는 .react.js) 필요성 JSX는 컴파일링되면서 최적화되므로 빠르다 Type-safe 하다 어떠한 연산도 정의되지 않은 결과를 내놓지 않는다. 즉 예측 불가능한 결과를 나타내지 않는다. 예컨대 1+”1”의 연산이 가능하다거나, 문자열 변수에 숫자를 할당하는 것이 가능하다거나 하는 것은 일면 비논리적이라고 볼 수 있다. 이러한 비논리를 엄격히 체크하여 runtime 시 이로 인한 오류를 발생하지 않도록 하겠다는 개념이 type-sa.. 더보기
Spring Boot, PostgreSQL, JPA, Hibernate RESTful CRUD API Example reference : https://www.callicoder.com/spring-boot-jpa-hibernate-postgresql-restful-crud-api-example/ Spring Boot, PostgreSQL, JPA, Hibernate RESTful CRUD API Example In this article, you'll learn how to configure Spring Boot to use PostgreSQL database and build a RESTful CRUD API from scratch. You'll also learn how Spring Data JPA and Hibernate can be used with PostgreSQL. www.callicoder.com 더보기